summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorLuis Marques <luismarques@lowrisc.org>2019-04-16 15:09:18 +0000
committerLuis Marques <luismarques@lowrisc.org>2019-04-16 15:09:18 +0000
commiteda370d4c819f37854458d8785693dbb04c8e67e (patch)
treeaa6ddcf2b5e0bb0a4aee4b3c04bffe143b390644 /llvm/lib
parentd465ee662dfac5a71a108478e4c3d6889e424fee (diff)
downloadbcm5719-llvm-eda370d4c819f37854458d8785693dbb04c8e67e.tar.gz
bcm5719-llvm-eda370d4c819f37854458d8785693dbb04c8e67e.zip
[DAGCombiner] Add missing flag to addressing mode check
The checks in `canFoldInAddressingMode` tested for addressing modes that have a base register but didn't set the `HasBaseReg` flag to true (it's false by default). This patch fixes that. Although the omission of the flag was technically incorrect it had no known observable impact, so no tests were changed by this patch. Differential Revision: https://reviews.llvm.org/D60314 llvm-svn: 358502
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 9dc33aa3979..b03c65ccf2c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12897,6 +12897,7 @@ static bool canFoldInAddressingMode(SDNode *N, SDNode *Use,
TargetLowering::AddrMode AM;
if (N->getOpcode() == ISD::ADD) {
+ AM.HasBaseReg = true;
ConstantSDNode *Offset = dyn_cast<ConstantSDNode>(N->getOperand(1));
if (Offset)
// [reg +/- imm]
@@ -12905,6 +12906,7 @@ static bool canFoldInAddressingMode(SDNode *N, SDNode *Use,
// [reg +/- reg]
AM.Scale = 1;
} else if (N->getOpcode() == ISD::SUB) {
+ AM.HasBaseReg = true;
ConstantSDNode *Offset = dyn_cast<ConstantSDNode>(N->getOperand(1));
if (Offset)
// [reg +/- imm]
OpenPOWER on IntegriCloud