mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-15 17:07:52 +00:00
ARM: Use a Handle to track SDNodes in case they're CSE'd. NFC
The code here is recursively Select-ing a new Node to avoid issues where N is CSE'd during replaceDAGValue and stops being valid. We can accomplish the same goal in a more principled way by using a HandleSDNode. This is essentially a less dodgy fix for PR25733 than the original attempt back in r255120. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268590 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8c98d34395
commit
18c56b7da0
@ -551,11 +551,9 @@ bool ARMDAGToDAGISel::SelectImmShifterOperand(SDValue N,
|
|||||||
unsigned PowerOfTwo = 0;
|
unsigned PowerOfTwo = 0;
|
||||||
SDValue NewMulConst;
|
SDValue NewMulConst;
|
||||||
if (canExtractShiftFromMul(N, 31, PowerOfTwo, NewMulConst)) {
|
if (canExtractShiftFromMul(N, 31, PowerOfTwo, NewMulConst)) {
|
||||||
BaseReg = SDValue(Select(CurDAG->getNode(ISD::MUL, SDLoc(N), MVT::i32,
|
HandleSDNode Handle(N);
|
||||||
N.getOperand(0), NewMulConst)
|
|
||||||
.getNode()),
|
|
||||||
0);
|
|
||||||
replaceDAGValue(N.getOperand(1), NewMulConst);
|
replaceDAGValue(N.getOperand(1), NewMulConst);
|
||||||
|
BaseReg = Handle.getValue();
|
||||||
Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ARM_AM::lsl,
|
Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ARM_AM::lsl,
|
||||||
PowerOfTwo),
|
PowerOfTwo),
|
||||||
SDLoc(N), MVT::i32);
|
SDLoc(N), MVT::i32);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user