[PATCH] D19518: Add optimization bisect opt-in calls for NVPTX passes

Jingyue Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 16:08:11 PDT 2016


jingyue accepted this revision.
jingyue added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D19518#412546, @andrew.w.kaylor wrote:

> In http://reviews.llvm.org/D19518#412434, @jingyue wrote:
>
> > Oh, I see what you mean now.
> >
> > So NVPTXPeephole should be guarded by `CodeGenOpt::None` and thus is safe to skip.
>
>
> The optnone-llc.ll test verifies that nothing is skipped which is run at -O0, so as long as this pass is being run at -O0 we can't add the call to skip it for "optnone" functions and bisection.  If the target machine code were updated to skip the peephole pass at -O0 then the skip check could be added.


In http://reviews.llvm.org/rL267619, I disabled NVPTXPeephole when CodeGenOpt::None. Can you add skipFunction in this patch accordingly?


================
Comment at: lib/Target/NVPTX/NVPTXLowerKernelArgs.cpp:196
@@ -195,1 +195,3 @@
 bool NVPTXLowerKernelArgs::runOnFunction(Function &F) {
+  if (skipFunction(F))
+    return false;
----------------
andrew.w.kaylor wrote:
> jingyue wrote:
> > handleByValParam is necessary for correctness, so NVPTXLowerKernelArgs can't be skipped unless we separate handleByValParam out to another pass. 
> As far as I can tell, this pass is only ever added by NVPTXPassConfig::addAddressSpaceInferencePasses(), which is not called when the opt level is CodeGenOpt::None.
> 
> So if this pass is necessary there may be another problem that needs to be addressed regarding when and where the pass gets added.
> 
> I'll take the skip check out, but that's something you may want to look into.
Thanks for pointing this out. I fixed this issue in rL267619.


Repository:
  rL LLVM

http://reviews.llvm.org/D19518





More information about the llvm-commits mailing list