diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-05-29 13:24:58 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-05-29 13:24:58 +0000 |
commit | 51152a3727938b325c65cce242e1e8afc73fc90e (patch) | |
tree | 2dacf821b7eb48389fb2835c313120d792899350 /llvm/lib/CodeGen | |
parent | fe0c0935c81cd3136045ccaee57cadbbc0dd2595 (diff) | |
download | bcm5719-llvm-51152a3727938b325c65cce242e1e8afc73fc90e.tar.gz bcm5719-llvm-51152a3727938b325c65cce242e1e8afc73fc90e.zip |
[DAGCombiner] fix load narrowing transform to exclude loads with extension
The extending load possibility was missed in:
https://reviews.llvm.org/rL304072
We might want to handle this cases as a follow-up, but bailing out for now
to avoid miscompiling.
llvm-svn: 304153
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 23a302f3e56..ab36bc1417a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -14567,7 +14567,8 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) { // extract instead or remove that condition entirely. auto *Ld = dyn_cast<LoadSDNode>(Extract->getOperand(0)); auto *ExtIdx = dyn_cast<ConstantSDNode>(Extract->getOperand(1)); - if (!Ld || !Ld->hasOneUse() || Ld->isVolatile() || !ExtIdx) + if (!Ld || !Ld->hasOneUse() || Ld->getExtensionType() || Ld->isVolatile() || + !ExtIdx) return SDValue(); // The narrow load will be offset from the base address of the old load if |