[PATCH] D135390: [SPIRV] Fix call lowering of "anonymous" functions

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 19:23:06 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp:467
       if (!isa<Function>(AnnotatedVar))
         llvm_unreachable("Unsupported value in llvm.global.annotations");
       Function *Func = cast<Function>(AnnotatedVar);
----------------
This should probably be report_fatal_error


================
Comment at: llvm/lib/Target/SPIRV/SPIRVMCInstLower.cpp:34
     case MachineOperand::MO_GlobalAddress: {
-      Register FuncReg = MAI->getFuncReg(MO.getGlobal()->getGlobalIdentifier());
+      Register FuncReg = MAI->getFuncReg(dyn_cast<Function>(MO.getGlobal()));
       assert(FuncReg.isValid() && "Cannot find function Id");
----------------
Does getFuncReg really handle the null case?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135390/new/

https://reviews.llvm.org/D135390



More information about the llvm-commits mailing list