22 changes: 8 additions & 14 deletions llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,11 @@ define i64 @fn2() {
; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 undef) #[[ATTR0]], !range [[RNG0:![0-9]+]]
; IS__TUNIT____-NEXT: ret i64 [[CALL2]]
;
; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fn2
; IS__CGSCC_OPM-SAME: () #[[ATTR0:[0-9]+]] {
; IS__CGSCC_OPM-NEXT: entry:
; IS__CGSCC_OPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 undef) #[[ATTR1:[0-9]+]]
; IS__CGSCC_OPM-NEXT: ret i64 [[CALL2]]
;
; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fn2
; IS__CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] {
; IS__CGSCC_NPM-NEXT: entry:
; IS__CGSCC_NPM-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 undef) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]]
; IS__CGSCC_NPM-NEXT: ret i64 [[CALL2]]
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@fn2
; IS__CGSCC____-SAME: () #[[ATTR0:[0-9]+]] {
; IS__CGSCC____-NEXT: entry:
; IS__CGSCC____-NEXT: ret i64 undef
;
entry:
%conv = sext i32 undef to i64
Expand All @@ -48,7 +40,7 @@ define i64 @fn2b(i32 %arg) {
;
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@fn2b
; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {
; IS__CGSCC____-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; IS__CGSCC____-NEXT: entry:
; IS__CGSCC____-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; IS__CGSCC____-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]]
Expand All @@ -74,6 +66,8 @@ define i64 @fn2c() {
; IS__CGSCC____-LABEL: define {{[^@]+}}@fn2c
; IS__CGSCC____-SAME: () #[[ATTR0]] {
; IS__CGSCC____-NEXT: entry:
; IS__CGSCC____-NEXT: [[CONV:%.*]] = sext i32 undef to i64
; IS__CGSCC____-NEXT: [[ADD:%.*]] = add i64 42, [[CONV]]
; IS__CGSCC____-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 noundef 42) #[[ATTR1]]
; IS__CGSCC____-NEXT: ret i64 [[CALL2]]
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,71 +7,59 @@ target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64le-unknown-linux"

define void @test(i32 signext %n) {
; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone
; IS__TUNIT____-LABEL: define {{[^@]+}}@test
; IS__TUNIT____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
; IS__TUNIT____-NEXT: entry:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.then:
; IS__TUNIT____-NEXT: ret void
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.end:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.then2:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.end4:
; IS__TUNIT____-NEXT: [[SUB_N:%.*]] = select i1 undef, i32 undef, i32 [[N]]
; IS__TUNIT____-NEXT: switch i32 [[SUB_N]], label [[IF_ELSE14:%.*]] [
; IS__TUNIT____-NEXT: i32 0, label [[IF_THEN9:%.*]]
; IS__TUNIT____-NEXT: i32 1, label [[IF_THEN12:%.*]]
; IS__TUNIT____-NEXT: ]
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.then9:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.then12:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.else14:
; IS__TUNIT____-NEXT: br label [[DO_BODY:%.*]]
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: do.body:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.then33:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: cond.false.i28:
; IS__TUNIT____-NEXT: [[TMP0:%.*]] = bitcast ppc_fp128 0xM3FF00000000000000000000000000000 to i128
; IS__TUNIT____-NEXT: [[TOBOOL_I26:%.*]] = icmp slt i128 [[TMP0]], 0
; IS__TUNIT____-NEXT: br label [[_ZN5BOOST4MATH4SIGNIGEEIRKT__EXIT30:%.*]]
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: _ZN5boost4math4signIgEEiRKT_.exit30:
; IS__TUNIT____-NEXT: unreachable
;
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone
; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone
; IS__CGSCC____-LABEL: define {{[^@]+}}@test
; IS__CGSCC____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
; IS__CGSCC____-NEXT: entry:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.then:
; IS__CGSCC____-NEXT: ret void
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.end:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.then2:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.end4:
; IS__CGSCC____-NEXT: [[SUB_N:%.*]] = select i1 undef, i32 undef, i32 [[N]]
; IS__CGSCC____-NEXT: switch i32 [[SUB_N]], label [[IF_ELSE14:%.*]] [
; IS__CGSCC____-NEXT: i32 0, label [[IF_THEN9:%.*]]
; IS__CGSCC____-NEXT: i32 1, label [[IF_THEN12:%.*]]
; IS__CGSCC____-NEXT: ]
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.then9:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.then12:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.else14:
; IS__CGSCC____-NEXT: br label [[DO_BODY:%.*]]
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: do.body:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.then33:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: cond.false.i28:
; IS__CGSCC____-NEXT: [[TMP0:%.*]] = bitcast ppc_fp128 0xM3FF00000000000000000000000000000 to i128
; IS__CGSCC____-NEXT: [[TOBOOL_I26:%.*]] = icmp slt i128 [[TMP0]], 0
; IS__CGSCC____-NEXT: br label [[_ZN5BOOST4MATH4SIGNIGEEIRKT__EXIT30:%.*]]
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: _ZN5boost4math4signIgEEiRKT_.exit30:
; IS__CGSCC____-NEXT: unreachable
;
Expand Down Expand Up @@ -121,7 +109,7 @@ _ZN5boost4math4signIgEEiRKT_.exit30: ; preds = %cond.false.i28, %if
}

;.
; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone }
; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone }
;.
; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone }
; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

declare i32 @external()

; FIXME: We should not return undef here.
define i8* @start(i8 %v) {
;
; IS__TUNIT____-LABEL: define {{[^@]+}}@start
; IS__TUNIT____-SAME: (i8 [[V:%.*]]) {
; IS__TUNIT____-NEXT: [[C1:%.*]] = icmp eq i8 [[V]], 0
Expand Down Expand Up @@ -52,7 +54,6 @@ false:
br i1 %c2, label %c2_true, label %c2_false
c2_true:
%ca1 = musttail call i8* @no_side_effects(i8 %v)
; FIXME: zap this call
ret i8* %ca1
c2_false:
%ca2 = musttail call i8* @dont_zap_me(i8 %v)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM

define internal i32 @testf(i1 %c) {
; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
; IS__TUNIT____-LABEL: define {{[^@]+}}@testf
; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
; IS__TUNIT____-NEXT: entry:
; IS__TUNIT____-NEXT: br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]]
; IS__TUNIT____: if.cond:
; IS__TUNIT____-NEXT: unreachable
; IS__TUNIT____: if.then:
; IS__TUNIT____-NEXT: ret i32 11
; IS__TUNIT____: if.end:
; IS__TUNIT____-NEXT: ret i32 10
;
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@testf
; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
Expand All @@ -25,9 +13,9 @@ define internal i32 @testf(i1 %c) {
; IS__CGSCC____: if.cond:
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.then:
; IS__CGSCC____-NEXT: ret i32 11
; IS__CGSCC____-NEXT: unreachable
; IS__CGSCC____: if.end:
; IS__CGSCC____-NEXT: ret i32 10
; IS__CGSCC____-NEXT: ret i32 undef
;
entry:
br i1 %c, label %if.cond, label %if.end
Expand All @@ -43,33 +31,17 @@ if.end: ; preds = %if.then1, %entry
}

define internal i32 @test1(i1 %c) {
; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
; IS__TUNIT____-LABEL: define {{[^@]+}}@test1
; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
; IS__TUNIT____-NEXT: entry:
; IS__TUNIT____-NEXT: br label [[IF_THEN:%.*]]
; IS__TUNIT____: if.then:
; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32 @testf(i1 [[C]]) #[[ATTR0]], !range [[RNG0:![0-9]+]]
; IS__TUNIT____-NEXT: [[RES:%.*]] = icmp eq i32 [[CALL]], 10
; IS__TUNIT____-NEXT: br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]]
; IS__TUNIT____: ret1:
; IS__TUNIT____-NEXT: ret i32 99
; IS__TUNIT____: ret2:
; IS__TUNIT____-NEXT: ret i32 0
;
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@test1
; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
; IS__CGSCC____-NEXT: entry:
; IS__CGSCC____-NEXT: br label [[IF_THEN:%.*]]
; IS__CGSCC____: if.then:
; IS__CGSCC____-NEXT: [[CALL:%.*]] = call i32 @testf(i1 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]]
; IS__CGSCC____-NEXT: [[RES:%.*]] = icmp eq i32 [[CALL]], 10
; IS__CGSCC____-NEXT: br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]]
; IS__CGSCC____-NEXT: br label [[RET1:%.*]]
; IS__CGSCC____: ret1:
; IS__CGSCC____-NEXT: ret i32 99
; IS__CGSCC____-NEXT: ret i32 undef
; IS__CGSCC____: ret2:
; IS__CGSCC____-NEXT: ret i32 0
; IS__CGSCC____-NEXT: unreachable
;
entry:
br label %if.then
Expand All @@ -89,15 +61,13 @@ ret2: ; preds = %if.then, %entry
define i32 @main(i1 %c) {
; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
; IS__TUNIT____-LABEL: define {{[^@]+}}@main
; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
; IS__TUNIT____-NEXT: [[RES:%.*]] = call i32 @test1(i1 [[C]]) #[[ATTR0]], !range [[RNG1:![0-9]+]]
; IS__TUNIT____-NEXT: ret i32 [[RES]]
; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
; IS__TUNIT____-NEXT: ret i32 99
;
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@main
; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
; IS__CGSCC____-NEXT: [[RES:%.*]] = call i32 @test1(i1 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]]
; IS__CGSCC____-NEXT: ret i32 [[RES]]
; IS__CGSCC____-NEXT: ret i32 99
;
%res = call i32 @test1(i1 %c)
ret i32 %res
Expand All @@ -106,8 +76,4 @@ define i32 @main(i1 %c) {
; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn }
;.
; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn }
;.
; CHECK: [[META0:![0-9]+]] = !{i32 10, i32 12}
; CHECK: [[META1:![0-9]+]] = !{i32 0, i32 100}
;.
7 changes: 1 addition & 6 deletions llvm/test/Transforms/Attributor/misc_crash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,16 @@ define i32* @func1() {
; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn
; CHECK-LABEL: define {{[^@]+}}@func1
; CHECK-SAME: () #[[ATTR0]] {
; CHECK-NEXT: [[PTR:%.*]] = call i32* @func1a() #[[ATTR0]]
; CHECK-NEXT: ret i32* [[PTR]]
; CHECK-NEXT: ret i32* getelementptr inbounds ([1 x i32], [1 x i32]* @var1, i32 0, i32 0)
;
%ptr = call i32* @func1a([1 x i32]* @var1)
ret i32* %ptr
}

; UTC_ARGS: --disable
; CHECK-LABEL: define internal noundef nonnull align 4 dereferenceable(4) i32* @func1a()
; CHECK-NEXT: ret i32* getelementptr inbounds ([1 x i32], [1 x i32]* @var1, i32 0, i32 0)
define internal i32* @func1a([1 x i32]* %arg) {
%ptr = getelementptr inbounds [1 x i32], [1 x i32]* %arg, i64 0, i64 0
ret i32* %ptr
}
; UTC_ARGS: --enable

define internal void @func2a(i32* %0) {
; CHECK: Function Attrs: nofree nosync nounwind willreturn writeonly
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/nodelete.ll
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ entry:
define internal i64 @f2(%"a"* %this) align 2 {
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@f2
; IS__CGSCC____-SAME: (%a* nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] align 2 {
; IS__CGSCC____-SAME: (%a* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] align 2 {
; IS__CGSCC____-NEXT: entry:
; IS__CGSCC____-NEXT: [[THIS_ADDR:%.*]] = alloca %a*, align 8
; IS__CGSCC____-NEXT: store %a* [[THIS]], %a** [[THIS_ADDR]], align 8
Expand Down
376 changes: 196 additions & 180 deletions llvm/test/Transforms/Attributor/nonnull.ll

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/noreturn_async.ll
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ entry:
; CHECK-NOT: nounwind
; CHECK-NEXT: define
; CHECK-NEXT: entry:
; CHECK-NEXT: %call3 = call i32 (i8*, ...) @printf(i8* noundef nonnull dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0))
; CHECK-NEXT: %call3 = call i32 (i8*, ...) @printf(i8* noundef nonnull dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i32 0, i32 0))
; CHECK-NEXT: call void @"?overflow@@YAXXZ_may_throw"()
; CHECK-NEXT: unreachable
%call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0))
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/noreturn_sync.ll
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ entry:
; CHECK-NOT: nounwind
; CHECK-NEXT: define
; CHECK-NEXT: entry:
; CHECK-NEXT: %call3 = call i32 (i8*, ...) @printf(i8* noundef nonnull dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0))
; CHECK-NEXT: %call3 = call i32 (i8*, ...) @printf(i8* noundef nonnull dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i32 0, i32 0))
; CHECK-NEXT: call void @"?overflow@@YAXXZ_may_throw"()
; CHECK-NEXT: unreachable
%call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C@_0BC@NKPAGFFJ@Exception?5caught?6?$AA@", i64 0, i64 0))
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/Transforms/Attributor/potential.ll
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ define internal i32 @return2or4(i32 %c) {
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@return2or4
; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] {
; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0
; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 undef, i32 2, i32 4
; IS__CGSCC____-NEXT: ret i32 undef
;
%cmp = icmp eq i32 %c, 0
Expand Down Expand Up @@ -532,6 +534,7 @@ define i1 @potential_test10(i32 %c) {
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC____-LABEL: define {{[^@]+}}@potential_test10
; IS__CGSCC____-SAME: (i32 [[C:%.*]]) #[[ATTR0]] {
; IS__CGSCC____-NEXT: [[CMP:%.*]] = icmp eq i32 undef, 0
; IS__CGSCC____-NEXT: ret i1 false
;
%ret = call i32 @may_return_undef(i32 %c)
Expand Down
11 changes: 8 additions & 3 deletions llvm/test/Transforms/Attributor/range.ll
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,11 @@ define void @f1(i32){
; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1
; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] {
; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]]
; IS__CGSCC_NPM: 2:
; IS__CGSCC_NPM-NEXT: unreachable
; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp sgt i32 10, 15
; IS__CGSCC_NPM-NEXT: br i1 false, label [[TMP3:%.*]], label [[TMP4:%.*]]
; IS__CGSCC_NPM: 3:
; IS__CGSCC_NPM-NEXT: unreachable
; IS__CGSCC_NPM: 4:
; IS__CGSCC_NPM-NEXT: ret void
;
%2 = tail call i32 @r1(i32 %0)
Expand Down Expand Up @@ -1932,11 +1933,13 @@ define internal i32 @cast_and_return(i1 %c) {
; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@cast_and_return
; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = zext i1 undef to i32
; IS__CGSCC_OPM-NEXT: ret i32 undef
;
; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@cast_and_return
; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = zext i1 undef to i32
; IS__CGSCC_NPM-NEXT: ret i32 undef
;
%ret = zext i1 %c to i32
Expand Down Expand Up @@ -2280,11 +2283,13 @@ define internal i1 @is_less_than_100_2(i32 %c) {
; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@is_less_than_100_2
; IS__CGSCC_OPM-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] {
; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100
; IS__CGSCC_OPM-NEXT: ret i1 true
;
; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@is_less_than_100_2
; IS__CGSCC_NPM-SAME: (i32 noundef [[C:%.*]]) #[[ATTR1]] {
; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100
; IS__CGSCC_NPM-NEXT: ret i1 true
;
%cmp = icmp slt i32 %c, 100
Expand Down
98 changes: 50 additions & 48 deletions llvm/test/Transforms/Attributor/undefined_behavior.ll

Large diffs are not rendered by default.

206 changes: 136 additions & 70 deletions llvm/test/Transforms/Attributor/value-simplify.ll

Large diffs are not rendered by default.