[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
       
    Tue Sep  3 22:04:44 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:
Can't emit triple checks like this in generic code. Isn't there some override in needFuncLabels? 
https://github.com/llvm/llvm-project/pull/107013
    
    
More information about the llvm-commits
mailing list