summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-15 23:42:54 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-15 23:42:54 +0000
commite9e30d083c346e07401f396c19861947a43c5306 (patch)
treebc3a4716f1aea61d84b0d11ffcbf3e7dbcc61958
parent20349b88a6144f5d7f37ac5c1ec9035584f91427 (diff)
downloadbcm5719-llvm-e9e30d083c346e07401f396c19861947a43c5306.tar.gz
bcm5719-llvm-e9e30d083c346e07401f396c19861947a43c5306.zip
Handle register masks in branch folding.
Don't attempt to move instructions with regmask operands. They are most likely calls anyway. llvm-svn: 150634
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 4929e388900..6aa170b536e 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -1477,6 +1477,9 @@ MachineBasicBlock::iterator findHoistingInsertPosAndDeps(MachineBasicBlock *MBB,
bool IsDef = false;
for (unsigned i = 0, e = PI->getNumOperands(); !IsDef && i != e; ++i) {
const MachineOperand &MO = PI->getOperand(i);
+ // If PI has a regmask operand, it is probably a call. Separate away.
+ if (MO.isRegMask())
+ return Loc;
if (!MO.isReg() || MO.isUse())
continue;
unsigned Reg = MO.getReg();
@@ -1589,6 +1592,11 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
bool IsSafe = true;
for (unsigned i = 0, e = TIB->getNumOperands(); i != e; ++i) {
MachineOperand &MO = TIB->getOperand(i);
+ // Don't attempt to hoist instructions with register masks.
+ if (MO.isRegMask()) {
+ IsSafe = false;
+ break;
+ }
if (!MO.isReg())
continue;
unsigned Reg = MO.getReg();
OpenPOWER on IntegriCloud