diff options
| author | Matthias Braun <matze@braunis.de> | 2016-06-11 00:31:28 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2016-06-11 00:31:28 +0000 |
| commit | 959a8c974df3c0b9240172b685cd1563171b30a0 (patch) | |
| tree | a927eab535b160f0d80cdaae5b0a729780ca0ab4 /llvm/unittests | |
| parent | 940f425a43a6d65ae27bcc9ada16b72ce6af3e50 (diff) | |
| download | bcm5719-llvm-959a8c974df3c0b9240172b685cd1563171b30a0.tar.gz bcm5719-llvm-959a8c974df3c0b9240172b685cd1563171b30a0.zip | |
LiveIntervalAnalysis: findLastUseBefore() must ignore undef uses.
undef uses are no real uses of a register and must be ignored by
findLastUseBefore() so that handleMove() does not produce invalid live
intervals in some cases.
This fixed http://llvm.org/PR28083
llvm-svn: 272446
Diffstat (limited to 'llvm/unittests')
| -rw-r--r-- | llvm/unittests/MI/LiveIntervalTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp index e4567363d39..e0b3d5529af 100644 --- a/llvm/unittests/MI/LiveIntervalTest.cpp +++ b/llvm/unittests/MI/LiveIntervalTest.cpp @@ -329,6 +329,30 @@ TEST(LiveIntervalTest, MoveUpValNos) { }); } +TEST(LiveIntervalTest, MoveOverUndefUse0) { + // findLastUseBefore() used by handleMoveUp() must ignore undef operands. + liveIntervalTest( +" %0 = IMPLICIT_DEF\n" +" NOOP\n" +" NOOP implicit undef %0\n" +" %0 = IMPLICIT_DEF implicit %0(tied-def 0)\n", + [](MachineFunction &MF, LiveIntervals &LIS) { + testHandleMove(MF, LIS, 3, 1); + }); +} + +TEST(LiveIntervalTest, MoveOverUndefUse1) { + // findLastUseBefore() used by handleMoveUp() must ignore undef operands. + liveIntervalTest( +" %rax = IMPLICIT_DEF\n" +" NOOP\n" +" NOOP implicit undef %rax\n" +" %rax = IMPLICIT_DEF implicit %rax(tied-def 0)\n", + [](MachineFunction &MF, LiveIntervals &LIS) { + testHandleMove(MF, LIS, 3, 1); + }); +} + int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); initLLVM(); |

