[llvm] [AsmPrinter] Do not emit label instructions after the function body if the target is SPIR-V (PR #107013)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 13 11:34:46 PDT 2024
================
@@ -1960,7 +1960,9 @@ void AsmPrinter::emitFunctionBody() {
// are automatically sized.
bool EmitFunctionSize = MAI->hasDotTypeDotSizeDirective() && !TT.isWasm();
- if (EmitFunctionSize || needFuncLabels(*MF, *this)) {
+ // SPIR-V supports label instructions only inside a block, not after the
+ // function body.
+ if (!TT.isSPIRV() && (EmitFunctionSize || needFuncLabels(*MF, *this))) {
----------------
arsenm wrote:
The target and object format may be intricately linked, but we still have a defined SPIRV ObjectFormatType. So you can just change the getArch() == spirv check for a getObjectFormat() == spirv check?
https://github.com/llvm/llvm-project/pull/107013
More information about the llvm-commits
mailing list