hanchenye-llvm-project/polly/lib/CodeGen
Tobias Grosser 75dfaa1dbe BlockGenerator: Do not redundantly reload from PHI-allocas in non-affine stmts
Before this change we created an additional reload in the copy of the incoming
block of a PHI node to reload the incoming value, even though the necessary
value has already been made available by the normally generated scalar loads.
In this change, we drop the code that generates this redundant reload and
instead just reuse the scalar value already available.

Besides making the generated code slightly cleaner, this change also makes sure
that scalar loads go through the normal logic, which means they can be remapped
(e.g. to array slots) and corresponding code is generated to load from the
remapped location. Without this change, the original scalar load at the
beginning of the non-affine region would have been remapped, but the redundant
scalar load would continue to load from the old PHI slot location.

It might be possible to further simplify the code in addOperandToPHI,
but this would not only mean to pull out getNewValue, but to also change the
insertion point update logic. As this did not work when trying it the first
time, this change is likely not trivial. To not introduce bugs last minute, we
postpone further simplications to a subsequent commit.

We also document the current behavior a little bit better.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D28892

llvm-svn: 292486
2017-01-19 14:12:45 +00:00
..
BlockGenerators.cpp BlockGenerator: Do not redundantly reload from PHI-allocas in non-affine stmts 2017-01-19 14:12:45 +00:00
CodeGeneration.cpp [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00
CodegenCleanup.cpp Try to fix polly buildbots. 2016-07-06 02:21:00 +00:00
IRBuilder.cpp Perform copying to created arrays according to the packing transformation 2016-09-14 06:26:09 +00:00
IslAst.cpp IslAst: always use the context during ast generation 2016-11-10 09:39:58 +00:00
IslExprBuilder.cpp [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00
IslNodeBuilder.cpp Relax assert when setting access functions with invariant base pointers 2017-01-17 12:00:42 +00:00
LoopGenerators.cpp Fix clang-format 2016-12-19 14:06:40 +00:00
PPCGCodeGeneration.cpp Use typed enums to model MemoryKind and move MemoryKind out of ScopArrayInfo 2017-01-14 20:25:44 +00:00
RuntimeDebugBuilder.cpp Update for llvm r274769 2016-07-07 18:03:30 +00:00
Utils.cpp [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00