summaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2011-06-24 17:55:19 +0000
committerAkira Hatanaka <ahatanak@gmail.com>2011-06-24 17:55:19 +0000
commit8b2b713f686a6d4908b73c76759447aa87b62c4a (patch)
treedd636c3d6a359cfc55bf12896b8e4ea2a7db5de2 /lib/Target
parent35f4fb34ff60b8f23b2c9691b312bc67cac95eb4 (diff)
downloadexternal_llvm-8b2b713f686a6d4908b73c76759447aa87b62c4a.zip
external_llvm-8b2b713f686a6d4908b73c76759447aa87b62c4a.tar.gz
external_llvm-8b2b713f686a6d4908b73c76759447aa87b62c4a.tar.bz2
Prevent generation of redundant addiu instructions that compute address of
static variables or functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/Mips/MipsISelDAGToDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp
index c35c852..5f0c7e0 100644
--- a/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp
@@ -170,7 +170,8 @@ SelectAddr(SDValue Addr, SDValue &Offset, SDValue &Base) {
Addr.getOperand(0).getOpcode() == ISD::LOAD) &&
Addr.getOperand(1).getOpcode() == MipsISD::Lo) {
SDValue LoVal = Addr.getOperand(1);
- if (dyn_cast<ConstantPoolSDNode>(LoVal.getOperand(0))) {
+ if (isa<ConstantPoolSDNode>(LoVal.getOperand(0)) ||
+ isa<GlobalAddressSDNode>(LoVal.getOperand(0))) {
Base = Addr.getOperand(0);
Offset = LoVal.getOperand(0);
return true;