summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2015-05-09 03:13:37 +0000
committerJames Y Knight <jyknight@google.com>2015-05-09 03:13:37 +0000
commitfca02be3c1059fd513c2e912411a8bcf284a329a (patch)
treec3be6c59dce2c6b43136f612307277af9d948dcf /llvm/lib
parent71d19f3cd62a0b6c8c5bd4b8023e4533d44a05a2 (diff)
downloadbcm5719-llvm-fca02be3c1059fd513c2e912411a8bcf284a329a.tar.gz
bcm5719-llvm-fca02be3c1059fd513c2e912411a8bcf284a329a.zip
Fix MergeConsecutiveStore for non-byte-sized memory accesses.
The bug showed up as a compile-time assertion failure: Assertion `NumBits >= MIN_INT_BITS && "bitwidth too small"' failed when building msan tests on x86-64. Prior to r236850, this bug was masked due to a bogus alignment check, which also accidentally rejected non-byte-sized accesses. Afterwards, an invalid ElementSizeBytes == 0 got further into the function, and triggered the assertion failure. It would probably be a good idea to allow it to handle merging stores of unusual widths as well, but for now, to un-break it, I'm just making the minimal fix. Differential Revision: http://reviews.llvm.org/D9626 llvm-svn: 236927
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index bd61f0cbd53..3728168e693 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -10673,6 +10673,10 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode* St) {
bool NoVectors = DAG.getMachineFunction().getFunction()->hasFnAttribute(
Attribute::NoImplicitFloat);
+ // This function cannot currently deal with non-byte-sized memory sizes.
+ if (ElementSizeBytes * 8 != MemVT.getSizeInBits())
+ return false;
+
// Don't merge vectors into wider inputs.
if (MemVT.isVector() || !MemVT.isSimple())
return false;
OpenPOWER on IntegriCloud