Skip to content

Commit bd20307

Browse files
committed
AMDGPU: Silence a gcc warning
1 parent 952fe94 commit bd20307

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
25722572
unsigned &Mods,
25732573
bool IsCanonicalizing,
25742574
bool AllowAbs) const {
2575-
Mods = 0;
2575+
Mods = SISrcMods::NONE;
25762576
Src = In;
25772577

25782578
if (Src.getOpcode() == ISD::FNEG) {
@@ -2700,7 +2700,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3OMods(SDValue In, SDValue &Src,
27002700

27012701
bool AMDGPUDAGToDAGISel::SelectVOP3PMods(SDValue In, SDValue &Src,
27022702
SDValue &SrcMods, bool IsDOT) const {
2703-
unsigned Mods = 0;
2703+
unsigned Mods = SISrcMods::NONE;
27042704
Src = In;
27052705

27062706
// TODO: Handle G_FSUB 0 as fneg

llvm/lib/Target/AMDGPU/SIDefines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ enum OperandType : unsigned {
250250
// NEG and SEXT share same bit-mask because they can't be set simultaneously.
251251
namespace SISrcMods {
252252
enum : unsigned {
253+
NONE = 0,
253254
NEG = 1 << 0, // Floating-point negate modifier
254255
ABS = 1 << 1, // Floating-point absolute modifier
255256
SEXT = 1 << 0, // Integer sign-extend modifier

llvm/lib/Target/AMDGPU/VOP3Instructions.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ def VOP3_PERMLANE_Profile : VOP3_Profile<VOPProfile <[i32, i32, i32, i32]>, VOP3
681681
}
682682

683683
def opsel_i1timm : SDNodeXForm<timm, [{
684-
return CurDAG->getTargetConstant(N->getZExtValue() ? SISrcMods::OP_SEL_0 : 0, SDLoc(N), MVT::i32);
684+
return CurDAG->getTargetConstant(
685+
N->getZExtValue() ? SISrcMods::OP_SEL_0 : SISrcMods::NONE,
686+
SDLoc(N), MVT::i32);
685687
}]>;
686688
def gi_opsel_i1timm : GICustomOperandRenderer<"renderOpSelTImm">,
687689
GISDNodeXFormEquiv<opsel_i1timm>;

0 commit comments

Comments
 (0)