summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2017-05-24 19:56:39 +0000
committerNirav Dave <niravd@google.com>2017-05-24 19:56:39 +0000
commit7a8717d2165ec94ce882b4cc872582d109c41fbd (patch)
tree9fe6c88fa93f4a6bd259f384764c198a0c27969d /llvm/lib
parent27abe98cfabaffe66cbe3eef9cc11fbd3ef43921 (diff)
downloadbcm5719-llvm-7a8717d2165ec94ce882b4cc872582d109c41fbd.tar.gz
bcm5719-llvm-7a8717d2165ec94ce882b4cc872582d109c41fbd.zip
[DAG] Prevent crashes when merging constant stores with high-bit set. NFC.
llvm-svn: 303802
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index fc44fb424b7..d3c4da3a588 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12349,9 +12349,9 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts(
SDValue Val = St->getValue();
StoreInt <<= ElementSizeBytes * 8;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Val)) {
- StoreInt |= C->getAPIntValue().zext(SizeInBits);
+ StoreInt |= C->getAPIntValue().zextOrTrunc(SizeInBits);
} else if (ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(Val)) {
- StoreInt |= C->getValueAPF().bitcastToAPInt().zext(SizeInBits);
+ StoreInt |= C->getValueAPF().bitcastToAPInt().zextOrTrunc(SizeInBits);
} else {
llvm_unreachable("Invalid constant element type");
}
OpenPOWER on IntegriCloud