diff options
author | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2018-09-30 17:23:21 +0000 |
---|---|---|
committer | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2018-09-30 17:23:21 +0000 |
commit | 4af7f57bdf94fa24ffab5a4b0a8570dfafc8688e (patch) | |
tree | ff1eb6adcb3946c2eb6d2d6e7b6257a04b191f27 /llvm/lib/CodeGen/PHIElimination.cpp | |
parent | bc70c26ef43641ae1f1e161cb674fe3539805650 (diff) | |
download | llvm-4af7f57bdf94fa24ffab5a4b0a8570dfafc8688e.zip llvm-4af7f57bdf94fa24ffab5a4b0a8570dfafc8688e.tar.gz llvm-4af7f57bdf94fa24ffab5a4b0a8570dfafc8688e.tar.bz2 |
[PHIElimination] Update the regression test for PR16508
Summary:
When PR16508 was solved (in rL185363) a regression test was
added as test/CodeGen/PowerPC/2013-07-01-PHIElimBug.ll.
I discovered that the test case no longer reproduced the
scenario from PR16508. This problem could have been amended
by adding an extra RUN line with "-O1" (or possibly "-O0"),
but instead I added a mir-reproducer
test/CodeGen/PowerPC/2013-07-01-PHIElimBug.mir
to get a reproducer that is less sensitive to changes in
earlier passes (including O-level).
While being at it I also corrected a code comment in
PHIElimination::EliminatePHINodes that has been incorrect
since the related bugfix from rL185363.
Reviewers: MatzeB, hfinkel
Reviewed By: MatzeB
Subscribers: nemanjai, jsji, llvm-commits
Differential Revision: https://reviews.llvm.org/D52553
llvm-svn: 343416
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PHIElimination.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 7a5c200..fc95cdf 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -197,12 +197,11 @@ bool PHIElimination::runOnMachineFunction(MachineFunction &MF) { /// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions in /// predecessor basic blocks. bool PHIElimination::EliminatePHINodes(MachineFunction &MF, - MachineBasicBlock &MBB) { + MachineBasicBlock &MBB) { if (MBB.empty() || !MBB.front().isPHI()) return false; // Quick exit for basic blocks without PHIs. - // Get an iterator to the first instruction after the last PHI node (this may - // also be the end of the basic block). + // Get an iterator to the last PHI node. MachineBasicBlock::iterator LastPHIIt = std::prev(MBB.SkipPHIsAndLabels(MBB.begin())); |