diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-03-02 10:43:16 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-03-02 10:43:16 +0000 |
commit | 5de3b7f35131b3c17e0b3c711d47ab3fb2c1e9be (patch) | |
tree | 35a40f0fcc44031a2275279116980c6142ba511a | |
parent | 7b466d048110ec149446bfb9856f79b7b17cf5d3 (diff) | |
download | external_llvm-5de3b7f35131b3c17e0b3c711d47ab3fb2c1e9be.zip external_llvm-5de3b7f35131b3c17e0b3c711d47ab3fb2c1e9be.tar.gz external_llvm-5de3b7f35131b3c17e0b3c711d47ab3fb2c1e9be.tar.bz2 |
Mark dead def as unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34844 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/RegisterScavenging.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/RegisterScavenging.cpp b/lib/CodeGen/RegisterScavenging.cpp index 7efae9c..c5389d9 100644 --- a/lib/CodeGen/RegisterScavenging.cpp +++ b/lib/CodeGen/RegisterScavenging.cpp @@ -100,14 +100,18 @@ void RegScavenger::forward() { if (!MO.isReg() || !MO.isDef()) continue; unsigned Reg = MO.getReg(); + // If it's dead upon def, then it is now free. + if (MO.isDead()) { + setUnused(Reg); + continue; + } // Skip two-address destination operand. if (TID->findTiedToSrcOperand(i) != -1) { assert(isUsed(Reg)); continue; } assert(isUnused(Reg) || isReserved(Reg)); - if (!MO.isDead()) - setUsed(Reg); + setUsed(Reg); } } |