Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: lib/Target/PowerPC/PPCBranchSelector.cpp

Issue 183273009: Prep for merging 3.4: Undo changes from 3.3 branch (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp ('k') | lib/Target/PowerPC/PPCFrameLowering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/PowerPC/PPCBranchSelector.cpp
diff --git a/lib/Target/PowerPC/PPCBranchSelector.cpp b/lib/Target/PowerPC/PPCBranchSelector.cpp
index 3e608ca8f679000ceb737775a1757f94ace6ddbd..bd1c3786811049520b5b1810a43e5fc780bfeebd 100644
--- a/lib/Target/PowerPC/PPCBranchSelector.cpp
+++ b/lib/Target/PowerPC/PPCBranchSelector.cpp
@@ -112,21 +112,15 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
unsigned MBBStartOffset = 0;
for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
I != E; ++I) {
- MachineBasicBlock *Dest = 0;
- if (I->getOpcode() == PPC::BCC && !I->getOperand(2).isImm())
- Dest = I->getOperand(2).getMBB();
- else if ((I->getOpcode() == PPC::BDNZ8 || I->getOpcode() == PPC::BDNZ ||
- I->getOpcode() == PPC::BDZ8 || I->getOpcode() == PPC::BDZ) &&
- !I->getOperand(0).isImm())
- Dest = I->getOperand(0).getMBB();
-
- if (!Dest) {
+ if (I->getOpcode() != PPC::BCC || I->getOperand(2).isImm()) {
MBBStartOffset += TII->GetInstSizeInBytes(I);
continue;
}
// Determine the offset from the current branch to the destination
// block.
+ MachineBasicBlock *Dest = I->getOperand(2).getMBB();
+
int BranchSize;
if (Dest->getNumber() <= MBB.getNumber()) {
// If this is a backwards branch, the delta is the offset from the
« no previous file with comments | « lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp ('k') | lib/Target/PowerPC/PPCFrameLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698