mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Teach the selector to fold lo(g) into load instruction immediate fields
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
490ad08097
commit
4f0f86de5f
@ -413,6 +413,14 @@ bool PPCDAGToDAGISel::SelectAddr(SDOperand Addr, SDOperand &Op1,
|
||||
Op2 = Select(Addr.getOperand(0));
|
||||
}
|
||||
return false;
|
||||
} else if (Addr.getOperand(1).getOpcode() == PPCISD::Lo) {
|
||||
// Match LOAD (ADD (X, Lo(G))).
|
||||
assert(!cast<ConstantSDNode>(Addr.getOperand(1).getOperand(1))->getValue()
|
||||
&& "Cannot handle constant offsets yet!");
|
||||
Op1 = Addr.getOperand(1).getOperand(0); // The global address.
|
||||
assert(Op1.getOpcode() == ISD::TargetGlobalAddress);
|
||||
Op2 = Select(Addr.getOperand(0));
|
||||
return false; // [&g+r]
|
||||
} else {
|
||||
Op1 = Select(Addr.getOperand(0));
|
||||
Op2 = Select(Addr.getOperand(1));
|
||||
|
Loading…
Reference in New Issue
Block a user