Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

100 lines
3.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -S -passes=instcombine | FileCheck %s
; Derived from gcc.c-torture/execute/frame-address.c
define i32 @func(ptr %c, ptr %f) nounwind uwtable readnone noinline ssp {
; CHECK-LABEL: @func(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = alloca i8, align 1
; CHECK-NEXT: store i8 0, ptr [[D]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt ptr [[D]], [[C:%.*]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule ptr [[D]], [[F:%.*]]
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP2:%.*]] = and i1 [[CMP2]], [[NOT_CMP1]]
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.else:
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge ptr [[D]], [[F]]
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP5:%.*]] = and i1 [[CMP5]], [[NOT_CMP3]]
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: [[RETVAL_0_IN:%.*]] = phi i1 [ [[DOTCMP2]], [[IF_THEN]] ], [ [[DOTCMP5]], [[IF_ELSE]] ]
; CHECK-NEXT: [[RETVAL_0:%.*]] = zext i1 [[RETVAL_0_IN]] to i32
; CHECK-NEXT: ret i32 [[RETVAL_0]]
;
entry:
%d = alloca i8, align 1
store i8 0, ptr %d, align 1
%cmp = icmp ugt ptr %d, %c
br i1 %cmp, label %if.else, label %if.then
if.then: ; preds = %entry
%cmp2 = icmp ule ptr %d, %f
%not.cmp1 = icmp uge ptr %c, %f
%.cmp2 = and i1 %cmp2, %not.cmp1
%land.ext = zext i1 %.cmp2 to i32
br label %return
if.else: ; preds = %entry
%cmp5 = icmp uge ptr %d, %f
%not.cmp3 = icmp ule ptr %c, %f
%.cmp5 = and i1 %cmp5, %not.cmp3
%land.ext7 = zext i1 %.cmp5 to i32
br label %return
return: ; preds = %if.else, %if.then
%retval.0 = phi i32 [ %land.ext, %if.then ], [ %land.ext7, %if.else ]
ret i32 %retval.0
}
define i32 @func_logical(ptr %c, ptr %f) nounwind uwtable readnone noinline ssp {
; CHECK-LABEL: @func_logical(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = alloca i8, align 1
; CHECK-NEXT: store i8 0, ptr [[D]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt ptr [[D]], [[C:%.*]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule ptr [[D]], [[F:%.*]]
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP2:%.*]] = and i1 [[CMP2]], [[NOT_CMP1]]
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.else:
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge ptr [[D]], [[F]]
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP5:%.*]] = and i1 [[CMP5]], [[NOT_CMP3]]
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: [[RETVAL_0_IN:%.*]] = phi i1 [ [[DOTCMP2]], [[IF_THEN]] ], [ [[DOTCMP5]], [[IF_ELSE]] ]
; CHECK-NEXT: [[RETVAL_0:%.*]] = zext i1 [[RETVAL_0_IN]] to i32
; CHECK-NEXT: ret i32 [[RETVAL_0]]
;
entry:
%d = alloca i8, align 1
store i8 0, ptr %d, align 1
%cmp = icmp ugt ptr %d, %c
br i1 %cmp, label %if.else, label %if.then
if.then: ; preds = %entry
%cmp2 = icmp ule ptr %d, %f
%not.cmp1 = icmp uge ptr %c, %f
%.cmp2 = select i1 %cmp2, i1 %not.cmp1, i1 false
%land.ext = zext i1 %.cmp2 to i32
br label %return
if.else: ; preds = %entry
%cmp5 = icmp uge ptr %d, %f
%not.cmp3 = icmp ule ptr %c, %f
%.cmp5 = select i1 %cmp5, i1 %not.cmp3, i1 false
%land.ext7 = zext i1 %.cmp5 to i32
br label %return
return: ; preds = %if.else, %if.then
%retval.0 = phi i32 [ %land.ext, %if.then ], [ %land.ext7, %if.else ]
ret i32 %retval.0
}