[llvm] r319436 - [InstCombine] Additional test for PR35354, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 06:33:58 PST 2017


Author: abataev
Date: Thu Nov 30 06:33:58 2017
New Revision: 319436

URL: http://llvm.org/viewvc/llvm-project?rev=319436&view=rev
Log:
[InstCombine] Additional test for PR35354, NFC.

Modified:
    llvm/trunk/test/Transforms/InstCombine/load-bitcast-select.ll

Modified: llvm/trunk/test/Transforms/InstCombine/load-bitcast-select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/load-bitcast-select.ll?rev=319436&r1=319435&r2=319436&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/load-bitcast-select.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/load-bitcast-select.ll Thu Nov 30 06:33:58 2017
@@ -68,3 +68,20 @@ define i32 @store_bitcasted_load(i1 %con
   %ld = load i32, i32* %bc1
   ret i32 %ld
 }
+
+define void @bitcasted_store(i1 %cond, float* %loadaddr1, float* %loadaddr2, float* %storeaddr) {
+; CHECK-LABEL: @bitcasted_store(
+; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND:%.*]], float* [[LOADADDR1:%.*]], float* [[LOADADDR2:%.*]]
+; CHECK-NEXT:    [[INT_LOAD_ADDR:%.*]] = bitcast float* [[SEL]] to i32*
+; CHECK-NEXT:    [[LD:%.*]] = load i32, i32* [[INT_LOAD_ADDR]], align 4
+; CHECK-NEXT:    [[INT_STORE_ADDR:%.*]] = bitcast float* [[STOREADDR:%.*]] to i32*
+; CHECK-NEXT:    store i32 [[LD]], i32* [[INT_STORE_ADDR]], align 4
+; CHECK-NEXT:    ret void
+;
+  %sel = select i1 %cond, float* %loadaddr1, float* %loadaddr2
+  %int_load_addr = bitcast float* %sel to i32*
+  %ld = load i32, i32* %int_load_addr
+  %int_store_addr = bitcast float* %storeaddr to i32*
+  store i32 %ld, i32* %int_store_addr
+  ret void
+}




More information about the llvm-commits mailing list