diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-08-24 20:21:49 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-08-24 20:21:49 +0000 |
commit | 45d8dbc92d365e9c0a08ceb0bc7a9014e6064bdb (patch) | |
tree | a4cf62db30e1b44c00a4f0d1a3fd8921009ebf16 /lib/Target/Mips | |
parent | 6adeb67b33d718767ff25e935fbfafff8e5584e0 (diff) | |
download | external_llvm-45d8dbc92d365e9c0a08ceb0bc7a9014e6064bdb.zip external_llvm-45d8dbc92d365e9c0a08ceb0bc7a9014e6064bdb.tar.gz external_llvm-45d8dbc92d365e9c0a08ceb0bc7a9014e6064bdb.tar.bz2 |
In MipsDAGToDAGISel::SelectAddr, fold add node into address operand, if its
second operand is MipsISD::GPRel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r-- | lib/Target/Mips/MipsISelDAGToDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp index 5a97c17..4205223 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp @@ -337,8 +337,9 @@ SelectAddr(SDNode *Parent, SDValue Addr, SDValue &Base, SDValue &Offset) { // Generate: // lui $2, %hi($CPI1_0) // lwc1 $f0, %lo($CPI1_0)($2) - if (Addr.getOperand(1).getOpcode() == MipsISD::Lo) { - SDValue LoVal = Addr.getOperand(1), Opnd0 = LoVal.getOperand(0); + if (Addr.getOperand(1).getOpcode() == MipsISD::Lo || + Addr.getOperand(1).getOpcode() == MipsISD::GPRel) { + SDValue Opnd0 = Addr.getOperand(1).getOperand(0); if (isa<ConstantPoolSDNode>(Opnd0) || isa<GlobalAddressSDNode>(Opnd0) || isa<JumpTableSDNode>(Opnd0)) { Base = Addr.getOperand(0); |