diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-06-17 19:39:23 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-06-17 19:39:23 +0000 |
commit | 09c130981456e54305c0d05f7842aa15164d0950 (patch) | |
tree | 9816b2ffd7a9aa619317d49f3ef592a324049315 /lib/Target/Sparc/InstSelectSimple.cpp | |
parent | f70c22b019494723d0e706f93d6542dfaa6e73a5 (diff) |
Use addGlobalAddress and addMBB for call & branch targets instead of addPCDisp.
Abort if we see a PCRelativeDisp MachineOperand, to be safe. This matches
the X86 backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/InstSelectSimple.cpp')
-rw-r--r-- | lib/Target/Sparc/InstSelectSimple.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp index 8d308edbd8..50e58dc959 100644 --- a/lib/Target/Sparc/InstSelectSimple.cpp +++ b/lib/Target/Sparc/InstSelectSimple.cpp @@ -452,7 +452,7 @@ void V8ISel::visitCallInst(CallInst &I) { .addReg (ArgReg); } - BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0)); + BuildMI (BB, V8::CALL, 1).addGlobalAddress(I.getCalledFunction (), true); if (I.getType () == Type::VoidTy) return; unsigned DestReg = getReg (I); @@ -509,7 +509,7 @@ void V8ISel::visitBranchInst(BranchInst &I) { BasicBlock *takenSucc = I.getSuccessor (0); if (!I.isConditional()) { // Unconditional branch? if (I.getSuccessor(0) != NextBB) - BuildMI (BB, V8::BA, 1).addPCDisp (takenSucc); + BuildMI (BB, V8::BA, 1).addMBB (MBBMap[takenSucc]); return; } @@ -519,11 +519,11 @@ void V8ISel::visitBranchInst(BranchInst &I) { BuildMI (BB, V8::CMPri, 2).addSImm (0).addReg (CondReg); if (notTakenSucc == NextBB) { if (takenSucc != NextBB) - BuildMI (BB, V8::BNE, 1).addPCDisp (takenSucc); + BuildMI (BB, V8::BNE, 1).addMBB (MBBMap[takenSucc]); } else { - BuildMI (BB, V8::BE, 1).addPCDisp (notTakenSucc); + BuildMI (BB, V8::BE, 1).addMBB (MBBMap[notTakenSucc]); if (takenSucc != NextBB) - BuildMI (BB, V8::BA, 1).addPCDisp (takenSucc); + BuildMI (BB, V8::BA, 1).addMBB (MBBMap[takenSucc]); } } |