Skip to content

Commit

Permalink
AssumeBundleBuilder: switch placeholder from undef to poison [NFC]
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes authored and smallp-o-p committed Nov 3, 2024
1 parent 765e4d8 commit e38ca25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ struct AssumeSimplify {
CleanupToDo.insert(Assume);
if (BOI.Begin != BOI.End) {
Use *U = &Assume->op_begin()[BOI.Begin + ABA_WasOn];
U->set(UndefValue::get(U->get()->getType()));
U->set(PoisonValue::get(U->get()->getType()));
}
BOI.Tag = IgnoreTag;
};
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/Util/assume-simplify.ll
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ define i32 @test1(ptr %arg, ptr %arg1, i32 %arg2, i32 %arg3) {
; CHECK-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; CHECK-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; CHECK-NEXT: call void @may_throw()
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "ignore"(ptr undef) ]
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "ignore"(ptr poison) ]
; CHECK-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; CHECK-NEXT: br label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "ignore"(ptr undef, i64 4), "ignore"(ptr undef) ]
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "ignore"(ptr poison, i64 4), "ignore"(ptr poison) ]
; CHECK-NEXT: br label [[B]]
; CHECK: B:
; CHECK-NEXT: ret i32 0
Expand Down Expand Up @@ -278,7 +278,7 @@ define i32 @test5A(ptr dereferenceable(8) %p, i32 %i) {
; CHECK-SAME: (ptr dereferenceable(32) [[P:%.*]], i32 [[I:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[COND:%.*]] = icmp ne i32 [[I]], 0
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "ignore"(ptr undef, i32 32) ]
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "ignore"(ptr poison, i32 32) ]
; CHECK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: ret i32 0
Expand Down

0 comments on commit e38ca25

Please sign in to comment.