mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
When doing the very-late shift-and address-mode optimization,
create a new DAG node to represent the new shift to keep the DAG consistent, even though it'll almost always be folded into the address. If a user of the resulting address has multiple uses, the nodes may get revisited by a later MatchAddress call, in which case DAG inconsistencies do matter. This fixes PR2849. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57465 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -989,8 +989,11 @@ DOUT << "AlreadySelected " << AlreadySelected << "\n";
|
||||
SDValue(C2, 0), SDValue(C1, 0));
|
||||
SDValue NewAND = CurDAG->getNode(ISD::AND, N.getValueType(),
|
||||
Shift.getOperand(0), NewANDMask);
|
||||
SDValue NewSHIFT = CurDAG->getNode(ISD::SHL, N.getValueType(),
|
||||
NewAND, SDValue(C1, 0));
|
||||
NewANDMask.getNode()->setNodeId(Shift.getNode()->getNodeId());
|
||||
NewAND.getNode()->setNodeId(N.getNode()->getNodeId());
|
||||
CurDAG->ReplaceAllUsesWith(N, NewSHIFT);
|
||||
|
||||
AM.Scale = 1 << ShiftCst;
|
||||
AM.IndexReg = NewAND;
|
||||
|
Reference in New Issue
Block a user