@@ -580,11 +580,11 @@ LoongArchTargetLowering::lowerINTRINSIC_W_CHAIN(SDValue Op,
580
580
581
581
// Helper function that emits error message for intrinsics with void return
582
582
// value.
583
- static SDValue emitIntrinsicErrorMessage (SDValue Op, StringRef Name,
584
- StringRef ErrorMsg,
583
+ static SDValue emitIntrinsicErrorMessage (SDValue Op, StringRef ErrorMsg,
585
584
SelectionDAG &DAG) {
586
585
587
- DAG.getContext ()->emitError (" argument to '" + Name + " ' " + ErrorMsg);
586
+ DAG.getContext ()->emitError (" argument to '" + Op->getOperationName (0 ) + " ' " +
587
+ ErrorMsg);
588
588
return Op.getOperand (0 );
589
589
}
590
590
@@ -603,35 +603,31 @@ SDValue LoongArchTargetLowering::lowerINTRINSIC_VOID(SDValue Op,
603
603
case Intrinsic::loongarch_dbar: {
604
604
unsigned Imm = cast<ConstantSDNode>(Op2)->getZExtValue ();
605
605
if (!isUInt<15 >(Imm))
606
- return emitIntrinsicErrorMessage (Op, " __builtin_loongarch_dbar" ,
607
- ErrorMsgOOR, DAG);
606
+ return emitIntrinsicErrorMessage (Op, ErrorMsgOOR, DAG);
608
607
609
608
return DAG.getNode (LoongArchISD::DBAR, DL, MVT::Other, Op0,
610
609
DAG.getConstant (Imm, DL, GRLenVT));
611
610
}
612
611
case Intrinsic::loongarch_ibar: {
613
612
unsigned Imm = cast<ConstantSDNode>(Op2)->getZExtValue ();
614
613
if (!isUInt<15 >(Imm))
615
- return emitIntrinsicErrorMessage (Op, " __builtin_loongarch_ibar" ,
616
- ErrorMsgOOR, DAG);
614
+ return emitIntrinsicErrorMessage (Op, ErrorMsgOOR, DAG);
617
615
618
616
return DAG.getNode (LoongArchISD::IBAR, DL, MVT::Other, Op0,
619
617
DAG.getConstant (Imm, DL, GRLenVT));
620
618
}
621
619
case Intrinsic::loongarch_break: {
622
620
unsigned Imm = cast<ConstantSDNode>(Op2)->getZExtValue ();
623
621
if (!isUInt<15 >(Imm))
624
- return emitIntrinsicErrorMessage (Op, " __builtin_loongarch_break" ,
625
- ErrorMsgOOR, DAG);
622
+ return emitIntrinsicErrorMessage (Op, ErrorMsgOOR, DAG);
626
623
627
624
return DAG.getNode (LoongArchISD::BREAK, DL, MVT::Other, Op0,
628
625
DAG.getConstant (Imm, DL, GRLenVT));
629
626
}
630
627
case Intrinsic::loongarch_syscall: {
631
628
unsigned Imm = cast<ConstantSDNode>(Op2)->getZExtValue ();
632
629
if (!isUInt<15 >(Imm))
633
- return emitIntrinsicErrorMessage (Op, " __builtin_loongarch_syscall" ,
634
- ErrorMsgOOR, DAG);
630
+ return emitIntrinsicErrorMessage (Op, ErrorMsgOOR, DAG);
635
631
636
632
return DAG.getNode (LoongArchISD::SYSCALL, DL, MVT::Other, Op0,
637
633
DAG.getConstant (Imm, DL, GRLenVT));
0 commit comments