[llvm] [KernelInfo] Implement new LLVM IR pass for GPU code analysis (PR #102944)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 13:29:31 PDT 2024


================
@@ -338,6 +338,11 @@ class TargetSubtargetInfo : public MCSubtargetInfo {
   /// the pass, with architecture specific overrides providing the information
   /// where they are implemented.
   virtual bool supportsInitUndef() const { return false; }
+
+  /// For \p F, call \p Body with the name and value of each launch bound.
+  virtual void forEachLaunchBound(
+      const Function &F,
+      std::function<void(StringRef Name, unsigned Value)> Body) const {}
----------------
jdenny-ornl wrote:

> It would be more appropriate to add something to TargetTransformInfo.

Done.

> It also needs a more specific name and documentation comment.

I'm fine to change it, but what details do you want the name and comment to reveal?

> Also should use int64_t for arbitrary integer values
> 
> This can also be function_ref

Done.

https://github.com/llvm/llvm-project/pull/102944


More information about the llvm-commits mailing list