aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegisterScavenging.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-07-01 01:59:31 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-07-01 01:59:31 +0000
commit2578ba26e72e36dde64be0f52a2788480aad3378 (patch)
treecff0b3ae5b241d3ad9f268cdf515d8cff4f3aada /lib/CodeGen/RegisterScavenging.cpp
parent5bcc8bd0c60cfe583ee47852950aad9e532c932e (diff)
downloadexternal_llvm-2578ba26e72e36dde64be0f52a2788480aad3378.zip
external_llvm-2578ba26e72e36dde64be0f52a2788480aad3378.tar.gz
external_llvm-2578ba26e72e36dde64be0f52a2788480aad3378.tar.bz2
Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the code to annotate machineoperands to LiveIntervalAnalysis. It also add markers for implicit_def that define physical registers. The rest, is just a lot of details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegisterScavenging.cpp')
-rw-r--r--lib/CodeGen/RegisterScavenging.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/RegisterScavenging.cpp b/lib/CodeGen/RegisterScavenging.cpp
index 382741e..58f4284 100644
--- a/lib/CodeGen/RegisterScavenging.cpp
+++ b/lib/CodeGen/RegisterScavenging.cpp
@@ -254,6 +254,8 @@ void RegScavenger::forward() {
unsigned Idx = (i < NumECs)
? EarlyClobberMOs[i].second : DefMOs[i-NumECs].second;
unsigned Reg = MO.getReg();
+ if (MO.isUndef())
+ continue;
// If it's dead upon def, then it is now free.
if (MO.isDead()) {
@@ -262,7 +264,9 @@ void RegScavenger::forward() {
}
// Skip two-address destination operand.
- if (MI->isRegTiedToUseOperand(Idx)) {
+ unsigned UseIdx;
+ if (MI->isRegTiedToUseOperand(Idx, &UseIdx) &&
+ !MI->getOperand(UseIdx).isUndef()) {
assert(isUsed(Reg) && "Using an undefined register!");
continue;
}
@@ -316,6 +320,8 @@ void RegScavenger::backward() {
? *DefMOs[i].first : *EarlyClobberMOs[i-NumDefs].first;
unsigned Idx = (i < NumECs)
? DefMOs[i].second : EarlyClobberMOs[i-NumDefs].second;
+ if (MO.isUndef())
+ continue;
// Skip two-address destination operand.
if (MI->isRegTiedToUseOperand(Idx))