[llvm] 3f9d1f5 - [InstSimplify] Add tests for reinterpret load of floats (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 00:26:58 PST 2022


Author: Nikita Popov
Date: 2022-01-21T09:26:50+01:00
New Revision: 3f9d1f516e19cc9548cf17ec60b73300d4ab8360

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

LOG: [InstSimplify] Add tests for reinterpret load of floats (NFC)

Add tests for currently unsupported float types.

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 990063be0468..43038bcbdbfe 100644
--- a/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/loads.ll
@@ -100,17 +100,53 @@ define double @test8() {
 
 
 ; i128 load.
-define i128 @test9() {
-; LE-LABEL: @test9(
+define i128 @test_i128() {
+; LE-LABEL: @test_i128(
 ; LE-NEXT:    ret i128 2071796475790618158476296315
 ;
-; BE-LABEL: @test9(
+; BE-LABEL: @test_i128(
 ; BE-NEXT:    ret i128 2268949521066387161080
 ;
   %r = load i128, i128* bitcast({i64, i64}* @g3 to i128*)
   ret i128 %r
 }
 
+define fp128 @test_fp128() {
+; CHECK-LABEL: @test_fp128(
+; CHECK-NEXT:    [[R:%.*]] = load fp128, fp128* bitcast ({ i64, i64 }* @g3 to fp128*), align 16
+; CHECK-NEXT:    ret fp128 [[R]]
+;
+  %r = load fp128, fp128* bitcast({i64, i64}* @g3 to fp128*)
+  ret fp128 %r
+}
+
+define ppc_fp128 @test_ppc_fp128() {
+; CHECK-LABEL: @test_ppc_fp128(
+; CHECK-NEXT:    [[R:%.*]] = load ppc_fp128, ppc_fp128* bitcast ({ i64, i64 }* @g3 to ppc_fp128*), align 16
+; CHECK-NEXT:    ret ppc_fp128 [[R]]
+;
+  %r = load ppc_fp128, ppc_fp128* bitcast({i64, i64}* @g3 to ppc_fp128*)
+  ret ppc_fp128 %r
+}
+
+define x86_fp80 @test_x86_fp80() {
+; CHECK-LABEL: @test_x86_fp80(
+; CHECK-NEXT:    [[R:%.*]] = load x86_fp80, x86_fp80* bitcast ({ i64, i64 }* @g3 to x86_fp80*), align 16
+; CHECK-NEXT:    ret x86_fp80 [[R]]
+;
+  %r = load x86_fp80, x86_fp80* bitcast({i64, i64}* @g3 to x86_fp80*)
+  ret x86_fp80 %r
+}
+
+define bfloat @test_bfloat() {
+; CHECK-LABEL: @test_bfloat(
+; CHECK-NEXT:    [[R:%.*]] = load bfloat, bfloat* bitcast ({ i64, i64 }* @g3 to bfloat*), align 2
+; CHECK-NEXT:    ret bfloat [[R]]
+;
+  %r = load bfloat, bfloat* bitcast({i64, i64}* @g3 to bfloat*)
+  ret bfloat %r
+}
+
 ; vector load.
 define <2 x i64> @test10() {
 ; CHECK-LABEL: @test10(


        


More information about the llvm-commits mailing list