summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-05-01 19:51:15 +0000
committerVedant Kumar <vsk@apple.com>2018-05-01 19:51:15 +0000
commitd7117ed0f973371fb89a8647b92063c50562bd85 (patch)
tree4e9fe200eb14beba71277bdfdd2d5ba551a5846a /llvm/lib/CodeGen
parentcc7b2a55c2cd8c09f80e4ccd14af944f4df7d171 (diff)
downloadbcm5719-llvm-d7117ed0f973371fb89a8647b92063c50562bd85.tar.gz
bcm5719-llvm-d7117ed0f973371fb89a8647b92063c50562bd85.zip
[DAGCombiner] Fix SDLoc in a (sext (sextload x)) combine (3/N)
Prior to this patch, for the given test case, we would apply the location associated with the sdiv instruction to instructions which perform the load. Part of: llvm.org/PR37262. Differential Revision: https://reviews.llvm.org/D46222 llvm-svn: 331302
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 25deedc3af7..1fc55a3495e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7817,9 +7817,9 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
EVT MemVT = LN0->getMemoryVT();
if ((!LegalOperations && !LN0->isVolatile()) ||
TLI.isLoadExtLegal(ISD::SEXTLOAD, VT, MemVT)) {
- SDValue ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, DL, VT, LN0->getChain(),
- LN0->getBasePtr(), MemVT,
- LN0->getMemOperand());
+ SDValue ExtLoad =
+ DAG.getExtLoad(ISD::SEXTLOAD, SDLoc(LN0), VT, LN0->getChain(),
+ LN0->getBasePtr(), MemVT, LN0->getMemOperand());
CombineTo(N, ExtLoad);
DAG.ReplaceAllUsesOfValueWith(SDValue(LN0, 1), ExtLoad.getValue(1));
return SDValue(N, 0); // Return N so it doesn't get rechecked!
OpenPOWER on IntegriCloud