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/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
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/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 1810904b2c6..ba06f6266ed 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -12911,6 +12911,7 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts( StoreSDNode *St = cast<StoreSDNode>(StoreNodes[Idx].MemNode); SDValue Val = St->getValue(); + Val = peekThroughBitcast(Val); StoreInt <<= ElementSizeBits; if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Val)) { StoreInt |= C->getAPIntValue() |