[llvm] f28b026 - [InstSimplify] add a test for gep with poison operand (NFC)

Juneyoung Lee via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 18:03:25 PST 2021


Author: Juneyoung Lee
Date: 2021-01-05T11:03:11+09:00
New Revision: f28b026d32ca20208e24cab3aabb9d9fb0f1948a

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

LOG: [InstSimplify] add a test for gep with poison operand (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/gep.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/gep.ll b/llvm/test/Transforms/InstSimplify/gep.ll
index f60f0cb7fdca..804ce7f10a8c 100644
--- a/llvm/test/Transforms/InstSimplify/gep.ll
+++ b/llvm/test/Transforms/InstSimplify/gep.ll
@@ -218,7 +218,7 @@ define <vscale x 2 x i64*> @ptr_idx_mix_scalar_scalable_vector() {
 
 ; Check ConstantExpr::getGetElementPtr() using ElementCount for size queries - end.
 
-; TODO: this should return poison
+; TODO: these should return poison
 
 define i8* @poison() {
 ; CHECK-LABEL: @poison(
@@ -227,3 +227,12 @@ define i8* @poison() {
   %v = getelementptr i8, i8* poison, i64 1
   ret i8* %v
 }
+
+define i8* @poison2(i8* %baseptr) {
+; CHECK-LABEL: @poison2(
+; CHECK-NEXT:    [[V:%.*]] = getelementptr i8, i8* [[BASEPTR:%.*]], i64 poison
+; CHECK-NEXT:    ret i8* [[V]]
+;
+  %v = getelementptr i8, i8* %baseptr, i64 poison
+  ret i8* %v
+}


        


More information about the llvm-commits mailing list