diff options
author | Brendon Cahoon <bcahoon@codeaurora.org> | 2016-08-16 14:29:24 +0000 |
---|---|---|
committer | Brendon Cahoon <bcahoon@codeaurora.org> | 2016-08-16 14:29:24 +0000 |
commit | 65b6ebccad08ff32d0fa3ce7987da5e509c454a6 (patch) | |
tree | 49c54b67c9cdf33a9deedbb9d30e225d2b975251 /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | 2ac5bf94bcaf5617a2f7efcefa2f16755faea8e2 (diff) | |
download | bcm5719-llvm-65b6ebccad08ff32d0fa3ce7987da5e509c454a6.tar.gz bcm5719-llvm-65b6ebccad08ff32d0fa3ce7987da5e509c454a6.zip |
[Pipeliner] Fix an asssert due to invalid Phi in the epilog
The pipeliner was generating an invalid Phi name for an operand
in the epilog block, which caused an assert in the live variable
analysis pass. The fix is to the code that generates new Phis
in the epilog block. In this case, there is an existing Phi that
needs to be reused rather than creating a new Phi instruction.
Differential Revision: https://reviews.llvm.org/D23513
llvm-svn: 278805
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachinePipeliner.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index 0add5540097..4e9f39eeb34 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -2648,8 +2648,7 @@ void SwingSchedulerDAG::generateExistingPhis( // references another Phi, and the other Phi is scheduled in an // earlier stage. We can try to reuse an existing Phi up until the last // stage of the current Phi. - if (LoopDefIsPhi && VRMap[CurStageNum].count(LoopVal) && - LoopValStage >= (int)(CurStageNum - LastStageNum)) { + if (LoopDefIsPhi && (int)PrologStage >= StageScheduled) { int LVNumStages = Schedule.getStagesForPhi(LoopVal); int StageDiff = (StageScheduled - LoopValStage); LVNumStages -= StageDiff; |