[GPGPU] Make sure escaping invariant load hoisted scalars are preserved
commitbb0d829764570a8a4ce2e72318d5cf0d9aeb2bcc
authorTobias Grosser <tobias@grosser.es>
Wed, 4 Oct 2017 10:24:23 +0000 (4 10:24 +0000)
committerTobias Grosser <tobias@grosser.es>
Wed, 4 Oct 2017 10:24:23 +0000 (4 10:24 +0000)
tree3d194d7853bb65c559dd38e8de92b1a918f63cc6
parent93ca95ac811df39e4cc070cb611ad50f882c896d
[GPGPU] Make sure escaping invariant load hoisted scalars are preserved

We make sure that the final reload of an invariant scalar memory access uses the
same stack slot into which the invariant memory access was stored originally.
Earlier, this was broken as we introduce a new stack slot aside of the preload
stack slot, which remained uninitialized and caused our escaping loads to
contain garbage. This happened due to us clearing the pre-populated values
in EscapeMap after kernel code generation. We address this issue by preserving
the original host values and restoring them after kernel code generation.
EscapeMap is not expected to be used during kernel code generation, hence we
clear it during kernel generation to make sure that any unintended uses are
noticed.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@314894 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/PPCGCodeGeneration.cpp
test/GPGPU/invariant-load-escaping-values.ll [new file with mode: 0644]