From: Weining Lu Date: Wed, 11 Jan 2023 09:11:40 +0000 (+0800) Subject: [LoongArch] Refine the condition to return Match_RequiresAMORdDifferRkRj in AsmParser... X-Git-Tag: upstream/17.0.6~21426 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43cf2f8103f9ef0f292c2cd12e89c55406182e1a;p=platform%2Fupstream%2Fllvm.git [LoongArch] Refine the condition to return Match_RequiresAMORdDifferRkRj in AsmParser. NFC This can suppress compilation warning like `enumerated mismatch in conditional expression`. See: https://lab.llvm.org/staging/#/builders/236/builds/645/steps/6/logs/warnings__1_ --- diff --git a/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp b/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp index b27070f..5517ce2 100644 --- a/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp +++ b/llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp @@ -1177,9 +1177,8 @@ unsigned LoongArchAsmParser::checkTargetMatchPredicate(MCInst &Inst) { unsigned Rd = Inst.getOperand(0).getReg(); unsigned Rk = Inst.getOperand(1).getReg(); unsigned Rj = Inst.getOperand(2).getReg(); - if (Rd == Rk || Rd == Rj) - return Rd == LoongArch::R0 ? Match_Success - : Match_RequiresAMORdDifferRkRj; + if ((Rd == Rk || Rd == Rj) && Rd != LoongArch::R0) + return Match_RequiresAMORdDifferRkRj; } break; case LoongArch::PseudoLA_PCREL_LARGE: