[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
This commit is contained in:
Luis Marques 2019-04-16 15:09:18 +00:00
parent d465ee662d
commit eda370d4c8
1 changed files with 2 additions and 0 deletions

View File

@ -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]