[llvm] [NFC][X86] Fix Werror=extra error due to enum (PR #112812)

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 06:00:32 PDT 2024


================
@@ -29986,7 +29986,7 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
           MVT::getVectorVT(NarrowScalarVT, WideNumElts), dl, AmtWideElts);
       AmtWide = DAG.getZExtOrTrunc(AmtWide, dl, WideVT);
       // Perform the actual shift.
-      unsigned LogicalOpc = Opc == ISD::SRA ? ISD::SRL : Opc;
+      unsigned LogicalOpc = Opc == ISD::SRA ? (unsigned)ISD::SRL : Opc;
----------------
jsji wrote:

It is about `Opc` is unsigned and `ISD::SRL` is enum, and they are used in the ?: operator, so type mismatch.

https://github.com/llvm/llvm-project/pull/112812


More information about the llvm-commits mailing list