浏览代码

When hoisting common code, watch out for uses which are marked "kill". If the
killed registers are needed below the insertion point, then unset the kill
marker.

Sorry I'm not able to find a reduced test case.

rdar://10660944


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

Evan Cheng 13 年之前
父节点
当前提交
c16c25fbc3
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      lib/CodeGen/BranchFolding.cpp

+ 5 - 0
lib/CodeGen/BranchFolding.cpp

@@ -1618,6 +1618,11 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
           IsSafe = false;
           break;
         }
+
+        if (MO.isKill() && Uses.count(Reg))
+          // Kills a register that's read by the instruction at the point of
+          // insertion. Remove the kill marker.
+          MO.setIsKill(false);
       }
     }
     if (!IsSafe)