Skip to content

Commit bf0aca9

Browse files
committed
Pass subtarget from caller
1 parent 0201aea commit bf0aca9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15894,10 +15894,8 @@ static SDValue expandMulToNAFSequence(SDNode *N, SelectionDAG &DAG,
1589415894

1589515895
// X * (2^N +/- 2^M) -> (add/sub (shl X, C1), (shl X, C2))
1589615896
static SDValue expandMulToAddOrSubOfShl(SDNode *N, SelectionDAG &DAG,
15897-
uint64_t MulAmt) {
15898-
// Don't do this is if the Xqciac extension is enabled and the MulAmt is
15899-
// simm12.
15900-
auto &Subtarget = DAG.getSubtarget<RISCVSubtarget>();
15897+
uint64_t MulAmt,
15898+
const RISCVSubtarget &Subtarget) {
1590115899
if (Subtarget.hasVendorXqciac() && isInt<12>(MulAmt))
1590215900
return SDValue();
1590315901

@@ -16085,7 +16083,7 @@ static SDValue expandMul(SDNode *N, SelectionDAG &DAG,
1608516083
}
1608616084
}
1608716085

16088-
if (SDValue V = expandMulToAddOrSubOfShl(N, DAG, MulAmt))
16086+
if (SDValue V = expandMulToAddOrSubOfShl(N, DAG, MulAmt, Subtarget))
1608916087
return V;
1609016088

1609116089
if (!Subtarget.hasStdExtZmmul())

0 commit comments

Comments
 (0)