[llvm] 0f283de - [InstSimplify] Add test for reinterpret load of pointer type (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 07:26:04 PST 2022


Author: Nikita Popov
Date: 2022-01-20T16:25:54+01:00
New Revision: 0f283de9d195e873006ae522660698b10bd81452

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

LOG: [InstSimplify] Add test for reinterpret load of pointer type (NFC)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll b/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
index afdc9980ab4f9..fb56cb342f4a3 100644
--- a/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
@@ -336,3 +336,14 @@ define i32 @load_all_undef() {
   %v = load i32, i32* getelementptr (i32, i32* bitcast ({ i32, [4 x i8] }* @g_all_undef to i32*), i64 1)
   ret i32 %v
 }
+
+ at g_i8_data = constant [16 x i8] c"\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
+
+define i64* @load_ptr_from_i8_data() {
+; CHECK-LABEL: @load_ptr_from_i8_data(
+; CHECK-NEXT:    [[V:%.*]] = load i64*, i64** bitcast ([16 x i8]* @g_i8_data to i64**), align 8
+; CHECK-NEXT:    ret i64* [[V]]
+;
+  %v = load i64*, i64** bitcast ([16 x i8]* @g_i8_data to i64**)
+  ret i64* %v
+}


        


More information about the llvm-commits mailing list