@@ -4629,19 +4629,21 @@ void IRGenSILFunction::visitCondFailInst(swift::CondFailInst *i) {
4629
4629
Builder.CreateCondBr (cond, failBB, contBB);
4630
4630
Builder.emitBlock (failBB);
4631
4631
4632
- // Emit unique side-effecting inline asm calls in order to eliminate
4633
- // the possibility that an LLVM optimization or code generation pass
4634
- // will merge these blocks back together again. We emit an empty asm
4635
- // string with the side-effect flag set, and with a unique integer
4636
- // argument for each cond_fail we see in the function.
4637
- llvm::IntegerType *asmArgTy = IGM.Int32Ty ;
4638
- llvm::Type *argTys = { asmArgTy };
4639
- llvm::FunctionType *asmFnTy =
4640
- llvm::FunctionType::get (IGM.VoidTy , argTys, false /* = isVarArg */ );
4641
- llvm::InlineAsm *inlineAsm =
4642
- llvm::InlineAsm::get (asmFnTy, " " , " n" , true /* = SideEffects */ );
4643
- Builder.CreateCall (inlineAsm,
4644
- llvm::ConstantInt::get (asmArgTy, NumCondFails++));
4632
+ if (IGM.IRGen .Opts .Optimize ) {
4633
+ // Emit unique side-effecting inline asm calls in order to eliminate
4634
+ // the possibility that an LLVM optimization or code generation pass
4635
+ // will merge these blocks back together again. We emit an empty asm
4636
+ // string with the side-effect flag set, and with a unique integer
4637
+ // argument for each cond_fail we see in the function.
4638
+ llvm::IntegerType *asmArgTy = IGM.Int32Ty ;
4639
+ llvm::Type *argTys = { asmArgTy };
4640
+ llvm::FunctionType *asmFnTy =
4641
+ llvm::FunctionType::get (IGM.VoidTy , argTys, false /* = isVarArg */ );
4642
+ llvm::InlineAsm *inlineAsm =
4643
+ llvm::InlineAsm::get (asmFnTy, " " , " n" , true /* = SideEffects */ );
4644
+ Builder.CreateCall (inlineAsm,
4645
+ llvm::ConstantInt::get (asmArgTy, NumCondFails++));
4646
+ }
4645
4647
4646
4648
// Emit the trap instruction.
4647
4649
llvm::Function *trapIntrinsic =
0 commit comments