OSDN Git Service

LivePhysRegs: Follow-up to r303937
authorMatthias Braun <matze@braunis.de>
Fri, 26 May 2017 00:54:24 +0000 (00:54 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 26 May 2017 00:54:24 +0000 (00:54 +0000)
We may have situations in which a superregister is reserved and not
added to liveins, so we have to add the subregisters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303949 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LivePhysRegs.cpp

index 59860e3..774fa4c 100644 (file)
@@ -230,7 +230,7 @@ void llvm::computeLiveIns(LivePhysRegs &LiveRegs,
     // Skip the register if we are about to add one of its super registers.
     bool ContainsSuperReg = false;
     for (MCSuperRegIterator SReg(Reg, &TRI); SReg.isValid(); ++SReg) {
-      if (LiveRegs.contains(*SReg)) {
+      if (LiveRegs.contains(*SReg) && !MRI.isReserved(*SReg)) {
         ContainsSuperReg = true;
         break;
       }