[NVPTX] Add missing pass names
authorIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 12 Jul 2022 14:58:13 +0000 (07:58 -0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 12 Jul 2022 14:58:13 +0000 (07:58 -0700)
Differential Revision:

llvm/lib/Target/NVPTX/NVPTXImageOptimizer.cpp
llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp
llvm/test/CodeGen/NVPTX/pass-name.ll [new file with mode: 0644]

index eeedce2..202134e 100644 (file)
@@ -35,6 +35,8 @@ public:
 
   bool runOnFunction(Function &F) override;
 
+  StringRef getPassName() const override { return "NVPTX Image Optimizer"; }
+
 private:
   bool replaceIsTypePSampler(Instruction &I);
   bool replaceIsTypePSurface(Instruction &I);
index 16fbe1a..7929bd2 100644 (file)
@@ -36,6 +36,8 @@ public:
 
   bool runOnMachineFunction(MachineFunction &MF) override;
 
+  StringRef getPassName() const override { return "NVPTX Prolog Epilog Pass"; }
+
 private:
   void calculateFrameObjectOffsets(MachineFunction &Fn);
 };
diff --git a/llvm/test/CodeGen/NVPTX/pass-name.ll b/llvm/test/CodeGen/NVPTX/pass-name.ll
new file mode 100644 (file)
index 0000000..77fc979
--- /dev/null
@@ -0,0 +1,3 @@
+; Check that all passes have names
+; RUN: llc %s -march=nvptx64 -O3 --debug-pass=Structure -o /dev/null 2>&1 | FileCheck %s
+; CHECK-NOT: Unnamed pass