summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-06-13 20:33:18 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-06-13 20:33:18 +0000
commit8782707f5074ab3951eb6424394bc8d2a2fa584a (patch)
treeee883b378ee78e6092120edb704593ce17bc1107 /lib/Target/Mips/MipsISelDAGToDAG.cpp
parente193b325837bee5f9a848a16077a6e156fe88fba (diff)
downloadllvm-8782707f5074ab3951eb6424394bc8d2a2fa584a.tar.gz
llvm-8782707f5074ab3951eb6424394bc8d2a2fa584a.tar.bz2
llvm-8782707f5074ab3951eb6424394bc8d2a2fa584a.tar.xz
Implement a DAGCombine in MipsISelLowering.cpp which transforms the following
pattern: (add v0, (add v1, abs_lo(tjt))) => (add (add v0, v1), abs_lo(tjt)) "tjt" is a TargetJumpTable node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsISelDAGToDAG.cpp')
-rw-r--r--lib/Target/Mips/MipsISelDAGToDAG.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp
index 62f7cdea3c..b0513c3127 100644
--- a/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp
@@ -335,11 +335,11 @@ SelectAddr(SDNode *Parent, SDValue Addr, SDValue &Base, SDValue &Offset) {
// lui $2, %hi($CPI1_0)
// lwc1 $f0, %lo($CPI1_0)($2)
if (Addr.getOperand(1).getOpcode() == MipsISD::Lo) {
- SDValue LoVal = Addr.getOperand(1);
- if (isa<ConstantPoolSDNode>(LoVal.getOperand(0)) ||
- isa<GlobalAddressSDNode>(LoVal.getOperand(0))) {
+ SDValue LoVal = Addr.getOperand(1), Opnd0 = LoVal.getOperand(0);
+ if (isa<ConstantPoolSDNode>(Opnd0) || isa<GlobalAddressSDNode>(Opnd0) ||
+ isa<JumpTableSDNode>(Opnd0)) {
Base = Addr.getOperand(0);
- Offset = LoVal.getOperand(0);
+ Offset = Opnd0;
return true;
}
}