[llvm] [AsmPrinter] Reduce AsmPrinterHandlers virt. fn calls (PR #96785)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 13:46:57 PDT 2024


================
@@ -382,13 +382,10 @@ class AsmPrinterHandlerTest : public AsmPrinterFixtureBase {
   public:
     TestHandler(AsmPrinterHandlerTest &Test) : Test(Test) {}
     virtual ~TestHandler() {}
-    virtual void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {}
     virtual void beginModule(Module *M) override { Test.BeginCount++; }
     virtual void endModule() override { Test.EndCount++; }
     virtual void beginFunction(const MachineFunction *MF) override {}
     virtual void endFunction(const MachineFunction *MF) override {}
-    virtual void beginInstruction(const MachineInstr *MI) override {}
----------------
aengelke wrote:

> Instruction count may only have a weak correlation with wall time though

I know and also do time measurements locally. Indirect function calls are frequently less efficient than, e.g., arithmetic instructions.

> addDebugHandler looks good for me, but might need a new test here?

Good, thanks for checking! I'll add a test case.

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


More information about the llvm-commits mailing list