aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-05-23 19:20:57 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-05-23 19:20:57 +0000
commitf96eb64666003112b3a525820d0ad64df90b3e73 (patch)
tree338cd1f0f37506c8add1f6aa3051f86b76a66872 /lib/Target
parentbaf850a51a253a39c60196343d756197bfbb27db (diff)
downloadexternal_llvm-f96eb64666003112b3a525820d0ad64df90b3e73.zip
external_llvm-f96eb64666003112b3a525820d0ad64df90b3e73.tar.gz
external_llvm-f96eb64666003112b3a525820d0ad64df90b3e73.tar.bz2
Cleaned up code layout; no functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/SparcV9/SparcV9PeepholeOpts.cpp44
1 files changed, 20 insertions, 24 deletions
diff --git a/lib/Target/SparcV9/SparcV9PeepholeOpts.cpp b/lib/Target/SparcV9/SparcV9PeepholeOpts.cpp
index 9cff89f..73e9ec9 100644
--- a/lib/Target/SparcV9/SparcV9PeepholeOpts.cpp
+++ b/lib/Target/SparcV9/SparcV9PeepholeOpts.cpp
@@ -22,21 +22,19 @@ DeleteInstruction(MachineBasicBlock& mvec,
const TargetMachine& target)
{
// Check if this instruction is in a delay slot of its predecessor.
- if (BBI != mvec.begin())
- {
+ if (BBI != mvec.begin()) {
const TargetInstrInfo& mii = target.getInstrInfo();
MachineInstr* predMI = *(BBI-1);
- if (unsigned ndelay = mii.getNumDelaySlots(predMI->getOpCode()))
- {
- // This instruction is in a delay slot of its predecessor, so
- // replace it with a nop. By replacing in place, we save having
- // to update the I-I maps.
- //
- assert(ndelay == 1 && "Not yet handling multiple-delay-slot targets");
- (*BBI)->replace(mii.getNOPOpCode(), 0);
- return;
- }
- }
+ if (unsigned ndelay = mii.getNumDelaySlots(predMI->getOpCode())) {
+ // This instruction is in a delay slot of its predecessor, so
+ // replace it with a nop. By replacing in place, we save having
+ // to update the I-I maps.
+ //
+ assert(ndelay == 1 && "Not yet handling multiple-delay-slot targets");
+ (*BBI)->replace(mii.getNOPOpCode(), 0);
+ return;
+ }
+ }
// The instruction is not in a delay slot, so we can simply erase it.
mvec.erase(BBI);
@@ -51,11 +49,10 @@ RemoveUselessCopies(MachineBasicBlock& mvec,
MachineBasicBlock::iterator& BBI,
const TargetMachine& target)
{
- if (target.getOptInfo().IsUselessCopy(*BBI))
- {
- DeleteInstruction(mvec, BBI, target);
- return true;
- }
+ if (target.getOptInfo().IsUselessCopy(*BBI)) {
+ DeleteInstruction(mvec, BBI, target);
+ return true;
+ }
return false;
}
@@ -117,11 +114,11 @@ PeepholeOpts::runOnBasicBlock(BasicBlock &BB)
//
for (MachineBasicBlock::reverse_iterator RI=mvec.rbegin(),
RE=mvec.rend(); RI != RE; )
- {
- MachineBasicBlock::iterator BBI = RI.base()-1; // save before incr
- ++RI; // pre-increment to delete MI or after it
- visit(mvec, BBI);
- }
+ {
+ MachineBasicBlock::iterator BBI = RI.base()-1; // save before incr
+ ++RI; // pre-increment to delete MI or after it
+ visit(mvec, BBI);
+ }
return true;
}
@@ -136,4 +133,3 @@ createPeepholeOptsPass(TargetMachine &T)
{
return new PeepholeOpts(T);
}
-