NVVMIntrRange adds !range metadata to calls of NVVM intrinsics
that return values within known limited range.
This allows LLVM to generate better code for indexing arrays
based on tid/ctaid which is a frequently used pattern in CUDA code.
Differential D20644
[NVPTX] Added NVVMIntrRange pass tra on May 25 2016, 2:10 PM. Authored by
Details NVVMIntrRange adds !range metadata to calls of NVVM intrinsics This allows LLVM to generate better code for indexing arrays
Diff Detail
Event TimelineComment Actions \o/
Comment Actions Have you considered letting Clang (instead of a late-stage IR pass) add these ranges? These ranges are useful for some target-independent IR passes, e.g. those using ValueTracking (D4150).
Comment Actions This pass runs at the very beginning of optimization pipeline. Justin created hook for early target-specific passes in D18616.
Comment Actions
I'm happy if you want to do it in a separate patch, but we should definitely add testing of important intrinsics like these, one way or another. LGTM aside from the apparent integer overflow.
Comment Actions Use uint64_t to pass range limits so we don't risk overflow on the way to ConstantInt::get().
|