[PATCH] D47691: [NVPTX] Ignore target-cpu and -features for inling

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 3 14:32:55 PDT 2018


hfinkel added inline comments.


================
Comment at: lib/Target/NVPTX/NVPTXTargetTransformInfo.h:66
+  // attributes that were added to newer versions of LLVM/Clang: There are
+  // no incompatible functions in PTX, ptxas will throw errors in such cases.
+  bool areInlineCompatible(const Function *Caller,
----------------
"We can ignore potential problems in inlining because the assembler will generate errors later if we do the wrong thing" is probably not what we mean. Obviously the point of this function is to avoid inlining when that might cause a problem later (either in tools, such as the assembler, or at runtime). 

My understanding, from the ongoing discussions, is that PTX is backward compatible, and ptxas will generate code for the underlying target for all PTX uniformly during any given compilation (and, thus, regardless of what the attributes say, the generated machine code will use features from the most-recent specified target. This might not be completely true (i.e., ptxas might still generate code in light of different legalization decisions), but it might be true enough to be the desired behavior.


Repository:
  rL LLVM

https://reviews.llvm.org/D47691





More information about the llvm-commits mailing list