[PATCH] D58834: [AArch64/ARM] Fix two compiler warnings in InstructionSelector, NFCI
Jonas Hahnfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 10:22:31 PST 2019
Hahnfeld created this revision.
Hahnfeld added reviewers: aemerson, rovka, t.p.northover, rengolin.
Herald added subscribers: llvm-commits, jdoerfert, hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.
1. GCC complains that KnownValid is set but not used.
2. In ARMInstructionSelector::selectGlobal() the code is mixing "enumeral and non-enumeral type in conditional expression". Solve this by casting to unsigned which is the final type anyway.
Repository:
rL LLVM
https://reviews.llvm.org/D58834
Files:
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/lib/Target/ARM/ARMInstructionSelector.cpp
Index: llvm/lib/Target/ARM/ARMInstructionSelector.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMInstructionSelector.cpp
+++ llvm/lib/Target/ARM/ARMInstructionSelector.cpp
@@ -665,11 +665,12 @@
// FIXME: Taking advantage of MOVT for ELF is pretty involved, so we don't
// support it yet. See PR28229.
- unsigned Opc = UseMovt && !STI.isTargetELF()
- ? (UseOpcodeThatLoads ? ARM::MOV_ga_pcrel_ldr
- : Opcodes.MOV_ga_pcrel)
- : (UseOpcodeThatLoads ? ARM::LDRLIT_ga_pcrel_ldr
- : Opcodes.LDRLIT_ga_pcrel);
+ unsigned Opc =
+ UseMovt && !STI.isTargetELF()
+ ? (UseOpcodeThatLoads ? (unsigned)ARM::MOV_ga_pcrel_ldr
+ : Opcodes.MOV_ga_pcrel)
+ : (UseOpcodeThatLoads ? (unsigned)ARM::LDRLIT_ga_pcrel_ldr
+ : Opcodes.LDRLIT_ga_pcrel);
MIB->setDesc(TII.get(Opc));
int TargetFlags = ARMII::MO_NO_FLAG;
Index: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
+++ llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
@@ -503,6 +503,7 @@
!TargetRegisterInfo::isPhysicalRegister(I.getOperand(1).getReg()))) &&
"No phys reg on generic operator!");
assert(KnownValid || isValidCopy(I, DstRegBank, MRI, TRI, RBI));
+ (void)KnownValid;
return true;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58834.188937.patch
Type: text/x-patch
Size: 1616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190301/874726e7/attachment.bin>
More information about the llvm-commits
mailing list