summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-22 05:18:37 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-22 05:18:37 +0000
commit9e78ba4ddcf80e2e292220b4a07a9baba21cfa15 (patch)
tree19f60e821e52218ec843c071f49e1a963a9cbe3e /lib/Target
parentf0061998dd1256df1ba933e80fdad2f594ea3f50 (diff)
downloadllvm-9e78ba4ddcf80e2e292220b4a07a9baba21cfa15.tar.gz
llvm-9e78ba4ddcf80e2e292220b4a07a9baba21cfa15.tar.bz2
llvm-9e78ba4ddcf80e2e292220b4a07a9baba21cfa15.tar.xz
Merging r195399:
------------------------------------------------------------------------ r195399 | tstellar | 2013-11-21 16:41:08 -0800 (Thu, 21 Nov 2013) | 10 lines R600: Implement TargetInstrInfo::isLegalToSplitMBBAt() Splitting a basic block will create a new ALU clause, so we need to make sure we aren't moving uses of registers that are local to their current clause into a new one. I had a test case for this, but unfortunately unrelated schedule changes invalidated it, and I wasn't been able to come up with another one. NOTE: This is a candidate for the 3.4 branch. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/R600/R600InstrInfo.cpp12
-rw-r--r--lib/Target/R600/R600InstrInfo.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/R600/R600InstrInfo.cpp b/lib/Target/R600/R600InstrInfo.cpp
index 1f4741634e..c0827fc1ca 100644
--- a/lib/Target/R600/R600InstrInfo.cpp
+++ b/lib/Target/R600/R600InstrInfo.cpp
@@ -77,6 +77,18 @@ R600InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
}
}
+/// \returns true if \p MBBI can be moved into a new basic.
+bool R600InstrInfo::isLegalToSplitMBBAt(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator MBBI) const {
+ for (MachineInstr::const_mop_iterator I = MBBI->operands_begin(),
+ E = MBBI->operands_end(); I != E; ++I) {
+ if (I->isReg() && !TargetRegisterInfo::isVirtualRegister(I->getReg()) &&
+ I->isUse() && RI.isPhysRegLiveAcrossClauses(I->getReg()))
+ return false;
+ }
+ return true;
+}
+
unsigned R600InstrInfo::getIEQOpcode() const {
return AMDGPU::SETE_INT;
}
diff --git a/lib/Target/R600/R600InstrInfo.h b/lib/Target/R600/R600InstrInfo.h
index b29b91f8d7..13d981094e 100644
--- a/lib/Target/R600/R600InstrInfo.h
+++ b/lib/Target/R600/R600InstrInfo.h
@@ -55,6 +55,8 @@ namespace llvm {
MachineBasicBlock::iterator MI, DebugLoc DL,
unsigned DestReg, unsigned SrcReg,
bool KillSrc) const;
+ bool isLegalToSplitMBBAt(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator MBBI) const;
bool isTrig(const MachineInstr &MI) const;
bool isPlaceHolderOpcode(unsigned opcode) const;