[llvm] 4d3284c - [ConstFold] Add test for incorrect gep inbounds of undef fold (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 02:14:17 PDT 2024


Author: Nikita Popov
Date: 2024-05-28T11:14:07+02:00
New Revision: 4d3284cadfa0dc9850d58b97e943481a30c39c1b

URL: https://github.com/llvm/llvm-project/commit/4d3284cadfa0dc9850d58b97e943481a30c39c1b
DIFF: https://github.com/llvm/llvm-project/commit/4d3284cadfa0dc9850d58b97e943481a30c39c1b.diff

LOG: [ConstFold] Add test for incorrect gep inbounds of undef fold (NFC)

If the offset is zero, then returning poison here is not correct.

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/ConstProp/poison.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/ConstProp/poison.ll b/llvm/test/Transforms/InstSimplify/ConstProp/poison.ll
index 49ca79554542f..cc498abd9af0f 100644
--- a/llvm/test/Transforms/InstSimplify/ConstProp/poison.ll
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/poison.ll
@@ -104,14 +104,14 @@ define void @vec_aggr_ops() {
 
 define void @other_ops(i8 %x) {
 ; CHECK-LABEL: @other_ops(
-; CHECK-NEXT:    call void (...) @use(i1 poison, i1 poison, i8 poison, i8 poison, ptr poison, ptr poison)
+; CHECK-NEXT:    call void (...) @use(i1 poison, i1 poison, i8 poison, i8 poison, ptr poison, ptr poison, ptr poison)
 ; CHECK-NEXT:    ret void
 ;
   %i1 = icmp eq i8 poison, 1
   %i2 = fcmp oeq float poison, 1.0
   %i3 = select i1 poison, i8 1, i8 2
   %i4 = select i1 true, i8 poison, i8 %x
-  call void (...) @use(i1 %i1, i1 %i2, i8 %i3, i8 %i4, ptr getelementptr (i8, ptr poison, i64 1), ptr getelementptr inbounds (i8, ptr undef, i64 1))
+  call void (...) @use(i1 %i1, i1 %i2, i8 %i3, i8 %i4, ptr getelementptr (i8, ptr poison, i64 1), ptr getelementptr inbounds (i8, ptr undef, i64 0), ptr getelementptr inbounds (i8, ptr undef, i64 1))
   ret void
 }
 


        


More information about the llvm-commits mailing list