Skip to content

Commit 5421a4c

Browse files
committed
[NFC][X86] Fix Werror=extra error due to enum
This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on. Built by GCC 11. Fix warnings: llvm-project/llvm/lib/Target/X86/X86FastISel.cpp: In member function ‘virtual bool {anonymous}::X86FastISel::fastLowerCall(llvm::FastISel::CallLoweringInfo&)’: llvm-project/llvm/lib/Target/X86/X86FastISel.cpp:3547: error: enumerated and non-enumerated type in conditional expression [-Werror=extra] 3547 | MIB.addReg(Is64Bit ? X86::RIP : 0).addImm(1).addReg(0);
1 parent c3bbc3a commit 5421a4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Target/X86/X86FastISel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,7 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
35443544

35453545
MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(CallOpc));
35463546
if (NeedLoad)
3547-
MIB.addReg(Is64Bit ? X86::RIP : 0).addImm(1).addReg(0);
3547+
MIB.addReg(Is64Bit ? X86::RIP : X86::NoRegister).addImm(1).addReg(0);
35483548
if (Symbol)
35493549
MIB.addSym(Symbol, OpFlags);
35503550
else

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29986,7 +29986,7 @@ static SDValue LowerShift(SDValue Op, const X86Subtarget &Subtarget,
2998629986
MVT::getVectorVT(NarrowScalarVT, WideNumElts), dl, AmtWideElts);
2998729987
AmtWide = DAG.getZExtOrTrunc(AmtWide, dl, WideVT);
2998829988
// Perform the actual shift.
29989-
unsigned LogicalOpc = Opc == ISD::SRA ? ISD::SRL : Opc;
29989+
unsigned LogicalOpc = Opc == ISD::SRA ? (unsigned)ISD::SRL : Opc;
2999029990
SDValue ShiftedR = DAG.getNode(LogicalOpc, dl, WideVT, RWide, AmtWide);
2999129991
// Now we need to construct a mask which will "drop" bits that get
2999229992
// shifted past the LSB/MSB. For a logical shift left, it will look

0 commit comments

Comments
 (0)