[PATCH] D52238: [CodeGen] Enable tail calls for functions with NonNull attributes.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 15:31:29 PDT 2018


efriedma added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:1876
-            .removeAttribute(Attribute::NoAlias))
-      continue;
-
----------------
dmgreen wrote:
> efriedma wrote:
> > I don't follow why you're deleting this code.
> Oh right, I meant to put a comment about that. From what I can tell it appears to be testing CalleeAttrs against itself, and this check should be handled by the calls to attributesPermitTailCall above. Unless I'm missing what this is testing?
Oh, yes, I see.  This isn't doing anything.

Please make sure we have appropriate test coverage (maybe in test/CodeGen/X86/tailcall-cgp-dup.ll).


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:63
           .removeAttribute(Attribute::NoAlias)
+          .removeAttribute(Attribute::NonNull)
           .hasAttributes())
----------------
Test coverage for this change?  (This codepath is primarily used by SelectionDAGLegalize::ExpandLibCall, so probably unlikely to be relevant in practice, but it should be possible to construct a synthetic testcase.)


https://reviews.llvm.org/D52238





More information about the llvm-commits mailing list