mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
LiveIntervalAnalysis: Fix handleMove() extending liverange for undef inputs
Fix handleMove() incorrectly extending liveranges when an undef input of a vreg was moved past the (current) end of the liverange. llvm-svn: 268805
This commit is contained in:
parent
751f932d9a
commit
9b767099e0
@ -939,10 +939,13 @@ public:
|
||||
hasRegMask = true;
|
||||
if (!MO.isReg())
|
||||
continue;
|
||||
if (MO.isUse()) {
|
||||
if (!MO.readsReg())
|
||||
continue;
|
||||
// Aggressively clear all kill flags.
|
||||
// They are reinserted by VirtRegRewriter.
|
||||
if (MO.isUse())
|
||||
MO.setIsKill(false);
|
||||
}
|
||||
|
||||
unsigned Reg = MO.getReg();
|
||||
if (!Reg)
|
||||
|
@ -300,6 +300,17 @@ TEST(LiveIntervalTest, MoveDownKillFollowing) {
|
||||
});
|
||||
}
|
||||
|
||||
TEST(LiveIntervalTest, MoveUndefUse) {
|
||||
liveIntervalTest(
|
||||
" %0 = IMPLICIT_DEF\n"
|
||||
" NOOP implicit undef %0\n"
|
||||
" NOOP implicit %0\n"
|
||||
" NOOP\n",
|
||||
[](MachineFunction &MF, LiveIntervals &LIS) {
|
||||
testHandleMove(MF, LIS, 1, 3);
|
||||
});
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
initLLVM();
|
||||
|
Loading…
Reference in New Issue
Block a user