[Polly] [PPCGCodeGeneration] Make sure invariant loads are generated before trying to generate LLVM from GPUNodeBuilder. [NFC]
ClosedPublic

Authored by bollu on Fri, Jul 14, 4:50 AM.

Details

Summary

We need to call preloadInvariantLoads to make sure that invariant loads are available for
BlockGenerators during copying.

Old hypothesis (left for context)
  • It would appear that we were not skipping invariant loads in BlockGenerators::copyInstruction. We should skip these, since we create new instructions that load the value at the hoisted location.

rename test again

triim trailing whitespace

Diff Detail

Repository
rL LLVM
bollu created this revision.Fri, Jul 14, 4:50 AM
bollu added inline comments.Fri, Jul 14, 4:52 AM
lib/CodeGen/BlockGenerators.cpp
198 ↗(On Diff #106621)

@grosser, @Meinersbur - I'm not sure about this change. I'm pinging Michael since he wrote the VirtualUse stuff :).

bollu planned changes to this revision.Fri, Jul 14, 5:22 AM

Nope, this is definitely incorrect, we generate incorrect IR in the kernel module.

grosser added inline comments.Fri, Jul 14, 6:19 AM
lib/CodeGen/BlockGenerators.cpp
198 ↗(On Diff #106621)

Why do you need this at all. Is skipping the load instruction not enough?

bollu updated this revision to Diff 106861.Mon, Jul 17, 6:26 AM
  • Call preloadInvariantLoads() before invoking GPUNodeBuilder::create.
bollu updated this revision to Diff 106869.Mon, Jul 17, 7:30 AM
  • [NFC wrt patch] remove debug metadata from testcase.
bollu retitled this revision from [Polly] [BlockGenerators] Teach BlockGenerators to skip copying invariant loads. [NFC] to [Polly] [BlockGenerators] [NFC].Mon, Jul 17, 7:31 AM
bollu retitled this revision from [Polly] [BlockGenerators] [NFC] to [Polly] [PPCGCodeGeneration] Make sure invariant loads are generated before trying to generate LLVM from GPUNodeBuilder. [NFC].
bollu edited the summary of this revision. (Show Details)
grosser accepted this revision.Mon, Jul 17, 8:32 AM

LGTM

This revision is now accepted and ready to land.Mon, Jul 17, 8:32 AM
This revision was automatically updated to reflect the committed changes.