[llvm] r263014 - Fix build error due to unsigned compare >= 0 in r263008 (NFC)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 9 06:58:24 PST 2016
Author: tejohnson
Date: Wed Mar 9 08:58:23 2016
New Revision: 263014
URL: http://llvm.org/viewvc/llvm-project?rev=263014&view=rev
Log:
Fix build error due to unsigned compare >= 0 in r263008 (NFC)
Fixes error from building with clang:
/usr/local/google/home/tejohnson/llvm/llvm_15/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp:407:12:
error: comparison of unsigned expression >= 0 is always true
[-Werror,-Wtautological-compare]
if ((Imm >= 0x000) && (Imm <= 0x0ff)) {
~~~ ^ ~~~~~
Modified:
llvm/trunk/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp?rev=263014&r1=263013&r2=263014&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp Wed Mar 9 08:58:23 2016
@@ -404,7 +404,7 @@ void AMDGPUInstPrinter::printOperandAndM
void AMDGPUInstPrinter::printDPPCtrlOperand(const MCInst *MI, unsigned OpNo,
raw_ostream &O) {
unsigned Imm = MI->getOperand(OpNo).getImm();
- if ((Imm >= 0x000) && (Imm <= 0x0ff)) {
+ if (Imm <= 0x0ff) {
O << " quad_perm:";
printU8ImmDecOperand(MI, OpNo, O);
} else if ((Imm >= 0x101) && (Imm <= 0x10f)) {
More information about the llvm-commits
mailing list