diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-05 20:04:18 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-05 20:04:18 +0000 |
commit | 86f26d2861aa414c18244b164aeefa2bb5ec5a58 (patch) | |
tree | ed6ff2e5b4d59f538b33fa2e7c0a0ad4ca324200 /lib/CodeGen | |
parent | f0ddba832b3d784bf98b6bbf6a4138b096a25d9f (diff) | |
download | external_llvm-86f26d2861aa414c18244b164aeefa2bb5ec5a58.zip external_llvm-86f26d2861aa414c18244b164aeefa2bb5ec5a58.tar.gz external_llvm-86f26d2861aa414c18244b164aeefa2bb5ec5a58.tar.bz2 |
If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index b39e48d..70c191d 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -436,8 +436,9 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) { if (MO.isRegister() && MO.isDef() && MO.getReg()) { if (MRegisterInfo::isVirtualRegister(MO.getReg())) { VarInfo &VRInfo = getVarInfo(MO.getReg()); - // Defaults to dead - VRInfo.Kills.push_back(MI); + if (VRInfo.AliveBlocks.none()) + // If vr is not alive in any block, then defaults to dead. + VRInfo.Kills.push_back(MI); } else if (MRegisterInfo::isPhysicalRegister(MO.getReg()) && !ReservedRegisters[MO.getReg()]) { HandlePhysRegDef(MO.getReg(), MI); |