This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] Move NVVMReflect pass out of codegen passes.
ClosedPublic

Authored by jlebar on Mar 30 2016, 11:56 AM.

Details

Summary

Currently the NVVMReflect pass is run at the beginning of our backend
passes. But really, it should be run as early as possible, as it's
simply resolving an "if" statement in code. So move it into
TargetMachine::addEarlyAsPossiblePasses.

(Specifically, NVVMReflect changes each call to the __nvvm_reflect
function or llvm.nvvm.reflect intrinsic into an integer constant, based
on the pass's configuration. Clearly we miss many optimization
opportunities if we perform this transformation at the beginning of
codegen.)

Diff Detail

Event Timeline

jlebar updated this revision to Diff 52099.Mar 30 2016, 11:56 AM
jlebar retitled this revision from to [NVPTX] Move NVVMReflect pass out of codegen passes..
jlebar updated this object.
jlebar added a reviewer: rnk.
jlebar added subscribers: llvm-commits, tra.
tra accepted this revision.Mar 30 2016, 1:11 PM
tra added a reviewer: tra.
This revision is now accepted and ready to land.Mar 30 2016, 1:11 PM
jlebar updated this revision to Diff 55278.Apr 27 2016, 12:01 PM
jlebar edited edge metadata.

Still run NVVMReflect at the start of the target-specific passes, since it's necessary for correctness.

This revision was automatically updated to reflect the committed changes.