diff options
author | Venkatraman Govindaraju <venkatra@cs.wisc.edu> | 2013-05-16 23:53:29 +0000 |
---|---|---|
committer | Venkatraman Govindaraju <venkatra@cs.wisc.edu> | 2013-05-16 23:53:29 +0000 |
commit | d6b4caf291aa8c3cd4bcb5f3b55b72621b506278 (patch) | |
tree | 335b922e8dc5dd1503c80978c946e52e009e2e9b /lib/Target/Sparc | |
parent | df68803890ecae2e8cfabdaa9122cb2ccbf5b89c (diff) | |
download | external_llvm-d6b4caf291aa8c3cd4bcb5f3b55b72621b506278.zip external_llvm-d6b4caf291aa8c3cd4bcb5f3b55b72621b506278.tar.gz external_llvm-d6b4caf291aa8c3cd4bcb5f3b55b72621b506278.tar.bz2 |
[Sparc] Prevent instructions that defines or uses %o7 to be in call's delay slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/DelaySlotFiller.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Target/Sparc/DelaySlotFiller.cpp b/lib/Target/Sparc/DelaySlotFiller.cpp index 6123773..db3f159 100644 --- a/lib/Target/Sparc/DelaySlotFiller.cpp +++ b/lib/Target/Sparc/DelaySlotFiller.cpp @@ -61,8 +61,9 @@ namespace { bool isDelayFiller(MachineBasicBlock &MBB, MachineBasicBlock::iterator candidate); - void insertCallUses(MachineBasicBlock::iterator MI, - SmallSet<unsigned, 32>& RegUses); + void insertCallDefsUses(MachineBasicBlock::iterator MI, + SmallSet<unsigned, 32>& RegDefs, + SmallSet<unsigned, 32>& RegUses); void insertDefsUses(MachineBasicBlock::iterator MI, SmallSet<unsigned, 32>& RegDefs, @@ -150,7 +151,7 @@ Filler::findDelayInstr(MachineBasicBlock &MBB, //Call's delay filler can def some of call's uses. if (slot->isCall()) - insertCallUses(slot, RegUses); + insertCallDefsUses(slot, RegDefs, RegUses); else insertDefsUses(slot, RegDefs, RegUses); @@ -230,9 +231,12 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate, } -void Filler::insertCallUses(MachineBasicBlock::iterator MI, - SmallSet<unsigned, 32>& RegUses) +void Filler::insertCallDefsUses(MachineBasicBlock::iterator MI, + SmallSet<unsigned, 32>& RegDefs, + SmallSet<unsigned, 32>& RegUses) { + //Call defines o7, which is visible to the instruction in delay slot. + RegDefs.insert(SP::O7); switch(MI->getOpcode()) { default: llvm_unreachable("Unknown opcode."); |