[llvm] 9fc535f - [AMDGPU] Fix gcc warnings
Sebastian Neubauer via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 6 02:01:25 PDT 2020
Author: Sebastian Neubauer
Date: 2020-10-06T10:55:08+02:00
New Revision: 9fc535f987b4fff62ec659d965b8ba1d371977fe
URL: https://github.com/llvm/llvm-project/commit/9fc535f987b4fff62ec659d965b8ba1d371977fe
DIFF: https://github.com/llvm/llvm-project/commit/9fc535f987b4fff62ec659d965b8ba1d371977fe.diff
LOG: [AMDGPU] Fix gcc warnings
uint8_t types are implicitly promoted to int, leading to a
unsigned-signed comparison.
Thanks for the heads-up @uabelho.
Differential Revision: https://reviews.llvm.org/D88876
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index fa3130ab3fe0..f141ca196a9a 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -3942,8 +3942,10 @@ static void packImageA16AddressToDwords(
// derivatives dx/dh and dx/dv are packed with undef.
if (((I + 1) >= EndIdx) ||
((Intr->NumGradients / 2) % 2 == 1 &&
- (I == Intr->GradientStart + (Intr->NumGradients / 2) - 1 ||
- I == Intr->GradientStart + Intr->NumGradients - 1)) ||
+ (I == static_cast<unsigned>(Intr->GradientStart +
+ (Intr->NumGradients / 2) - 1) ||
+ I == static_cast<unsigned>(Intr->GradientStart +
+ Intr->NumGradients - 1))) ||
// Check for _L to _LZ optimization
!MI.getOperand(ArgOffset + I + 1).isReg()) {
PackedAddrs.push_back(
More information about the llvm-commits
mailing list