diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-03-04 18:51:46 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-03-04 18:51:46 +0000 |
| commit | 4196dd12a2af34de8f1a527b741c81d88ffb181b (patch) | |
| tree | 3be527e3ed027edc38fc007e339cedc392cf25b3 /llvm/test/CodeGen | |
| parent | 5302604c328d299457150455b73a90d04604d1e5 (diff) | |
| download | bcm5719-llvm-4196dd12a2af34de8f1a527b741c81d88ffb181b.tar.gz bcm5719-llvm-4196dd12a2af34de8f1a527b741c81d88ffb181b.zip | |
[DAGCombiner] Add a peekThroughBitcast to MergeStoresOfConstantsOrVecElts to fix a crash if we are storing a bitcast of a constant.
Loading a constant into a k-register in AVX512 requires a bitcast from a scalar constant. In the test case here we have a k-register store that gets split into multiple parts of KNL. MergeConsecutiveStores sees each of these pieces as a consecutive store and looks through the bitcast to find the underly scalar constant. But when we went to create the combined store we didn't look through the same bitcast.
llvm-svn: 326677
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/avx512-mask-op.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx512-mask-op.ll b/llvm/test/CodeGen/X86/avx512-mask-op.ll index 1038c90ab9d..841f697a380 100644 --- a/llvm/test/CodeGen/X86/avx512-mask-op.ll +++ b/llvm/test/CodeGen/X86/avx512-mask-op.ll @@ -2795,3 +2795,35 @@ entry: ret <8 x i64> %8 } +define void @store_v64i1_constant(<64 x i1>* %R) { +; KNL-LABEL: store_v64i1_constant: +; KNL: ## %bb.0: ## %entry +; KNL-NEXT: kxnorw %k0, %k0, %k0 +; KNL-NEXT: kmovw %k0, 2(%rdi) +; KNL-NEXT: movl $-536871045, 4(%rdi) ## imm = 0xDFFFFF7B +; KNL-NEXT: movw $-4099, (%rdi) ## imm = 0xEFFD +; KNL-NEXT: retq +; +; SKX-LABEL: store_v64i1_constant: +; SKX: ## %bb.0: ## %entry +; SKX-NEXT: movabsq $-2305843576149381123, %rax ## imm = 0xDFFFFF7BFFFFEFFD +; SKX-NEXT: movq %rax, (%rdi) +; SKX-NEXT: retq +; +; AVX512BW-LABEL: store_v64i1_constant: +; AVX512BW: ## %bb.0: ## %entry +; AVX512BW-NEXT: movabsq $-2305843576149381123, %rax ## imm = 0xDFFFFF7BFFFFEFFD +; AVX512BW-NEXT: movq %rax, (%rdi) +; AVX512BW-NEXT: retq +; +; AVX512DQ-LABEL: store_v64i1_constant: +; AVX512DQ: ## %bb.0: ## %entry +; AVX512DQ-NEXT: kxnorw %k0, %k0, %k0 +; AVX512DQ-NEXT: kmovw %k0, 2(%rdi) +; AVX512DQ-NEXT: movl $-536871045, 4(%rdi) ## imm = 0xDFFFFF7B +; AVX512DQ-NEXT: movw $-4099, (%rdi) ## imm = 0xEFFD +; AVX512DQ-NEXT: retq +entry: + store <64 x i1> <i1 1, i1 0, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 0, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 0, i1 1, i1 1, i1 1, i1 1, i1 0, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 0, i1 1, i1 1>, <64 x i1>* %R + ret void +} |

