This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by bollu on Jul 14 2017, 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

Event Timeline

bollu created this revision.Jul 14 2017, 4:50 AM
bollu added inline comments.Jul 14 2017, 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.Jul 14 2017, 5:22 AM

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

grosser added inline comments.Jul 14 2017, 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.Jul 17 2017, 6:26 AM
  • Call preloadInvariantLoads() before invoking GPUNodeBuilder::create.
bollu updated this revision to Diff 106869.Jul 17 2017, 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].Jul 17 2017, 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.Jul 17 2017, 8:32 AM

LGTM

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