Skip to content

Commit aee4d94

Browse files
committed
Rename to getAsZExtVal
1 parent e4ef2c1 commit aee4d94

40 files changed

+148
-146
lines changed

llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,9 @@ END_TWO_BYTE_PACK()
923923

924924
/// Helper method returns the integer value of a ConstantSDNode operand.
925925
inline uint64_t getConstantOperandVal(unsigned Num) const;
926-
inline uint64_t getAsConstantVal() const;
926+
927+
/// Helper method returns the zero-extended integer value of a ConstantSDNode.
928+
inline uint64_t getAsZExtVal() const;
927929

928930
/// Helper method returns the APInt of a ConstantSDNode operand.
929931
inline const APInt &getConstantOperandAPInt(unsigned Num) const;
@@ -1641,7 +1643,7 @@ uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
16411643
return cast<ConstantSDNode>(getOperand(Num))->getZExtValue();
16421644
}
16431645

1644-
uint64_t SDNode::getAsConstantVal() const {
1646+
uint64_t SDNode::getAsZExtVal() const {
16451647
return cast<ConstantSDNode>(this)->getZExtValue();
16461648
}
16471649

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14709,7 +14709,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
1470914709

1471014710
SDValue EltNo = N0->getOperand(1);
1471114711
if (isa<ConstantSDNode>(EltNo) && isTypeLegal(NVT)) {
14712-
int Elt = EltNo->getAsConstantVal();
14712+
int Elt = EltNo->getAsZExtVal();
1471314713
int Index = isLE ? (Elt*SizeRatio) : (Elt*SizeRatio + (SizeRatio-1));
1471414714

1471514715
SDLoc DL(N);

llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ void InstrEmitter::EmitSubregNode(SDNode *Node,
551551
SDValue N0 = Node->getOperand(0);
552552
SDValue N1 = Node->getOperand(1);
553553
SDValue N2 = Node->getOperand(2);
554-
unsigned SubIdx = N2->getAsConstantVal();
554+
unsigned SubIdx = N2->getAsZExtVal();
555555

556556
// Figure out the register class to create for the destreg. It should be
557557
// the largest legal register class supporting SubIdx sub-registers.
@@ -650,7 +650,7 @@ void InstrEmitter::EmitRegSequence(SDNode *Node,
650650
// Skip physical registers as they don't have a vreg to get and we'll
651651
// insert copies for them in TwoAddressInstructionPass anyway.
652652
if (!R || !R->getReg().isPhysical()) {
653-
unsigned SubIdx = Op->getAsConstantVal();
653+
unsigned SubIdx = Op->getAsZExtVal();
654654
unsigned SubReg = getVR(Node->getOperand(i-1), VRBaseMap);
655655
const TargetRegisterClass *TRC = MRI->getRegClass(SubReg);
656656
const TargetRegisterClass *SRC =

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ SDValue DAGTypeLegalizer::PromoteFloatRes_EXTRACT_VECTOR_ELT(SDNode *N) {
24902490
EVT VecVT = Vec->getValueType(0);
24912491
EVT EltVT = VecVT.getVectorElementType();
24922492

2493-
uint64_t IdxVal = Idx->getAsConstantVal();
2493+
uint64_t IdxVal = Idx->getAsZExtVal();
24942494

24952495
switch (getTypeAction(VecVT)) {
24962496
default: break;

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5557,7 +5557,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_EXTRACT_SUBVECTOR(SDNode *N) {
55575557
getTypeAction(InVT) == TargetLowering::TypeLegal) {
55585558
EVT NInVT = InVT.getHalfNumVectorElementsVT(*DAG.getContext());
55595559
unsigned NElts = NInVT.getVectorMinNumElements();
5560-
uint64_t IdxVal = BaseIdx->getAsConstantVal();
5560+
uint64_t IdxVal = BaseIdx->getAsZExtVal();
55615561

55625562
SDValue Step1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, NInVT, InOp0,
55635563
DAG.getConstant(alignDown(IdxVal, NElts), dl,

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ void DAGTypeLegalizer::SplitVecRes_EXTRACT_SUBVECTOR(SDNode *N, SDValue &Lo,
14421442
std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0));
14431443

14441444
Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, LoVT, Vec, Idx);
1445-
uint64_t IdxVal = Idx->getAsConstantVal();
1445+
uint64_t IdxVal = Idx->getAsZExtVal();
14461446
Hi = DAG.getNode(
14471447
ISD::EXTRACT_SUBVECTOR, dl, HiVT, Vec,
14481448
DAG.getVectorIdxConstant(IdxVal + LoVT.getVectorMinNumElements(), dl));
@@ -1466,7 +1466,7 @@ void DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo,
14661466
// If we know the index is in the first half, and we know the subvector
14671467
// doesn't cross the boundary between the halves, we can avoid spilling the
14681468
// vector, and insert into the lower half of the split vector directly.
1469-
unsigned IdxVal = Idx->getAsConstantVal();
1469+
unsigned IdxVal = Idx->getAsZExtVal();
14701470
if (IdxVal + SubElems <= LoElems) {
14711471
Lo = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, LoVT, Lo, SubVec, Idx);
14721472
return;
@@ -3279,7 +3279,7 @@ SDValue DAGTypeLegalizer::SplitVecOp_INSERT_SUBVECTOR(SDNode *N,
32793279
SDValue Lo, Hi;
32803280
GetSplitVector(SubVec, Lo, Hi);
32813281

3282-
uint64_t IdxVal = Idx->getAsConstantVal();
3282+
uint64_t IdxVal = Idx->getAsZExtVal();
32833283
uint64_t LoElts = Lo.getValueType().getVectorMinNumElements();
32843284

32853285
SDValue FirstInsertion =
@@ -3301,7 +3301,7 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(SDNode *N) {
33013301
GetSplitVector(N->getOperand(0), Lo, Hi);
33023302

33033303
uint64_t LoEltsMin = Lo.getValueType().getVectorMinNumElements();
3304-
uint64_t IdxVal = Idx->getAsConstantVal();
3304+
uint64_t IdxVal = Idx->getAsZExtVal();
33053305

33063306
if (IdxVal < LoEltsMin) {
33073307
assert(IdxVal + SubVT.getVectorMinNumElements() <= LoEltsMin &&
@@ -5257,7 +5257,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_EXTRACT_SUBVECTOR(SDNode *N) {
52575257
EVT InVT = InOp.getValueType();
52585258

52595259
// Check if we can just return the input vector after widening.
5260-
uint64_t IdxVal = Idx->getAsConstantVal();
5260+
uint64_t IdxVal = Idx->getAsZExtVal();
52615261
if (IdxVal == 0 && InVT == WidenVT)
52625262
return InOp;
52635263

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7193,7 +7193,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
71937193
assert(isa<ConstantSDNode>(N3) &&
71947194
"Insert subvector index must be constant");
71957195
assert((VT.isScalableVector() != N2VT.isScalableVector() ||
7196-
(N2VT.getVectorMinNumElements() + N3->getAsConstantVal()) <=
7196+
(N2VT.getVectorMinNumElements() + N3->getAsZExtVal()) <=
71977197
VT.getVectorMinNumElements()) &&
71987198
"Insert subvector overflow!");
71997199
assert(cast<ConstantSDNode>(N3)->getAPIntValue().getBitWidth() ==
@@ -9982,7 +9982,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
99829982
Ops[1].getValueType().isFloatingPoint() &&
99839983
VTList.VTs[0].bitsLT(Ops[1].getValueType()) &&
99849984
isa<ConstantSDNode>(Ops[2]) &&
9985-
(Ops[2]->getAsConstantVal() == 0 || Ops[2]->getAsConstantVal() == 1) &&
9985+
(Ops[2]->getAsZExtVal() == 0 || Ops[2]->getAsZExtVal() == 1) &&
99869986
"Invalid STRICT_FP_ROUND!");
99879987
break;
99889988
#if 0

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5642,7 +5642,7 @@ static SDValue expandDivFix(unsigned Opcode, const SDLoc &DL,
56425642
// expansion/promotion) if it was possible to expand a libcall of an
56435643
// illegal type during operation legalization. But it's not, so things
56445644
// get a bit hacky.
5645-
unsigned ScaleInt = Scale->getAsConstantVal();
5645+
unsigned ScaleInt = Scale->getAsZExtVal();
56465646
if ((ScaleInt > 0 || (Saturating && Signed)) &&
56475647
(TLI.isTypeLegal(VT) ||
56485648
(VT.isVector() && TLI.isTypeLegal(VT.getVectorElementType())))) {
@@ -7655,7 +7655,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
76557655
// suitable for the target. Convert the index as required.
76567656
MVT VectorIdxTy = TLI.getVectorIdxTy(DAG.getDataLayout());
76577657
if (Index.getValueType() != VectorIdxTy)
7658-
Index = DAG.getVectorIdxConstant(Index->getAsConstantVal(), sdl);
7658+
Index = DAG.getVectorIdxConstant(Index->getAsZExtVal(), sdl);
76597659

76607660
EVT ResultVT = TLI.getValueType(DAG.getDataLayout(), I.getType());
76617661
setValue(&I, DAG.getNode(ISD::INSERT_SUBVECTOR, sdl, ResultVT, Vec, SubVec,
@@ -7671,7 +7671,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
76717671
// suitable for the target. Convert the index as required.
76727672
MVT VectorIdxTy = TLI.getVectorIdxTy(DAG.getDataLayout());
76737673
if (Index.getValueType() != VectorIdxTy)
7674-
Index = DAG.getVectorIdxConstant(Index->getAsConstantVal(), sdl);
7674+
Index = DAG.getVectorIdxConstant(Index->getAsZExtVal(), sdl);
76757675

76767676
setValue(&I,
76777677
DAG.getNode(ISD::EXTRACT_SUBVECTOR, sdl, ResultVT, Vec, Index));
@@ -8134,7 +8134,7 @@ void SelectionDAGBuilder::visitVectorPredicationIntrinsic(
81348134
case ISD::VP_IS_FPCLASS: {
81358135
const DataLayout DLayout = DAG.getDataLayout();
81368136
EVT DestVT = TLI.getValueType(DLayout, VPIntrin.getType());
8137-
auto Constant = OpValues[1]->getAsConstantVal();
8137+
auto Constant = OpValues[1]->getAsZExtVal();
81388138
SDValue Check = DAG.getTargetConstant(Constant, DL, MVT::i32);
81398139
SDValue V = DAG.getNode(ISD::VP_IS_FPCLASS, DL, DestVT,
81408140
{OpValues[0], Check, OpValues[2], OpValues[3]});
@@ -9171,7 +9171,7 @@ findMatchingInlineAsmOperand(unsigned OperandNo,
91719171
unsigned CurOp = InlineAsm::Op_FirstOperand;
91729172
for (; OperandNo; --OperandNo) {
91739173
// Advance to the next operand.
9174-
unsigned OpFlag = AsmNodeOperands[CurOp]->getAsConstantVal();
9174+
unsigned OpFlag = AsmNodeOperands[CurOp]->getAsZExtVal();
91759175
const InlineAsm::Flag F(OpFlag);
91769176
assert(
91779177
(F.isRegDefKind() || F.isRegDefEarlyClobberKind() || F.isMemKind()) &&
@@ -9477,7 +9477,7 @@ void SelectionDAGBuilder::visitInlineAsm(const CallBase &Call,
94779477
// just use its register.
94789478
auto CurOp = findMatchingInlineAsmOperand(OpInfo.getMatchedOperand(),
94799479
AsmNodeOperands);
9480-
InlineAsm::Flag Flag(AsmNodeOperands[CurOp]->getAsConstantVal());
9480+
InlineAsm::Flag Flag(AsmNodeOperands[CurOp]->getAsZExtVal());
94819481
if (Flag.isRegDefKind() || Flag.isRegDefEarlyClobberKind()) {
94829482
if (OpInfo.isIndirect) {
94839483
// This happens on gcc/testsuite/gcc.dg/pr8788-1.c
@@ -9982,13 +9982,13 @@ void SelectionDAGBuilder::visitStackmap(const CallInst &CI) {
99829982
SDValue ID = getValue(CI.getArgOperand(0));
99839983
assert(ID.getValueType() == MVT::i64);
99849984
SDValue IDConst =
9985-
DAG.getTargetConstant(ID->getAsConstantVal(), DL, ID.getValueType());
9985+
DAG.getTargetConstant(ID->getAsZExtVal(), DL, ID.getValueType());
99869986
Ops.push_back(IDConst);
99879987

99889988
SDValue Shad = getValue(CI.getArgOperand(1));
99899989
assert(Shad.getValueType() == MVT::i32);
99909990
SDValue ShadConst =
9991-
DAG.getTargetConstant(Shad->getAsConstantVal(), DL, Shad.getValueType());
9991+
DAG.getTargetConstant(Shad->getAsZExtVal(), DL, Shad.getValueType());
99929992
Ops.push_back(ShadConst);
99939993

99949994
// Add the live variables.
@@ -10037,7 +10037,7 @@ void SelectionDAGBuilder::visitPatchpoint(const CallBase &CB,
1003710037

1003810038
// Get the real number of arguments participating in the call <numArgs>
1003910039
SDValue NArgVal = getValue(CB.getArgOperand(PatchPointOpers::NArgPos));
10040-
unsigned NumArgs = NArgVal->getAsConstantVal();
10040+
unsigned NumArgs = NArgVal->getAsZExtVal();
1004110041

1004210042
// Skip the four meta args: <id>, <numNopBytes>, <target>, <numArgs>
1004310043
// Intrinsics include all meta-operands up to but not including CC.
@@ -10084,10 +10084,10 @@ void SelectionDAGBuilder::visitPatchpoint(const CallBase &CB,
1008410084

1008510085
// Add the <id> and <numBytes> constants.
1008610086
SDValue IDVal = getValue(CB.getArgOperand(PatchPointOpers::IDPos));
10087-
Ops.push_back(DAG.getTargetConstant(IDVal->getAsConstantVal(), dl, MVT::i64));
10087+
Ops.push_back(DAG.getTargetConstant(IDVal->getAsZExtVal(), dl, MVT::i64));
1008810088
SDValue NBytesVal = getValue(CB.getArgOperand(PatchPointOpers::NBytesPos));
1008910089
Ops.push_back(
10090-
DAG.getTargetConstant(NBytesVal->getAsConstantVal(), dl, MVT::i32));
10090+
DAG.getTargetConstant(NBytesVal->getAsZExtVal(), dl, MVT::i32));
1009110091

1009210092
// Add the callee.
1009310093
Ops.push_back(Callee);

llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
149149
case ISD::INTRINSIC_VOID:
150150
case ISD::INTRINSIC_W_CHAIN: {
151151
unsigned OpNo = getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 0 : 1;
152-
unsigned IID = getOperand(OpNo)->getAsConstantVal();
152+
unsigned IID = getOperand(OpNo)->getAsZExtVal();
153153
if (IID < Intrinsic::num_intrinsics)
154154
return Intrinsic::getBaseName((Intrinsic::ID)IID).str();
155155
if (!G)

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ void SelectionDAGISel::SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops,
21212121
--e; // Don't process a glue operand if it is here.
21222122

21232123
while (i != e) {
2124-
InlineAsm::Flag Flags(InOps[i]->getAsConstantVal());
2124+
InlineAsm::Flag Flags(InOps[i]->getAsZExtVal());
21252125
if (!Flags.isMemKind() && !Flags.isFuncKind()) {
21262126
// Just skip over this operand, copying the operands verbatim.
21272127
Ops.insert(Ops.end(), InOps.begin() + i,
@@ -2135,10 +2135,10 @@ void SelectionDAGISel::SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops,
21352135
if (Flags.isUseOperandTiedToDef(TiedToOperand)) {
21362136
// We need the constraint ID from the operand this is tied to.
21372137
unsigned CurOp = InlineAsm::Op_FirstOperand;
2138-
Flags = InlineAsm::Flag(InOps[CurOp]->getAsConstantVal());
2138+
Flags = InlineAsm::Flag(InOps[CurOp]->getAsZExtVal());
21392139
for (; TiedToOperand; --TiedToOperand) {
21402140
CurOp += Flags.getNumOperandRegisters() + 1;
2141-
Flags = InlineAsm::Flag(InOps[CurOp]->getAsConstantVal());
2141+
Flags = InlineAsm::Flag(InOps[CurOp]->getAsZExtVal());
21422142
}
21432143
}
21442144

@@ -2378,7 +2378,7 @@ void SelectionDAGISel::pushStackMapLiveVariable(SmallVectorImpl<SDValue> &Ops,
23782378
if (OpNode->getOpcode() == ISD::Constant) {
23792379
Ops.push_back(
23802380
CurDAG->getTargetConstant(StackMaps::ConstantOp, DL, MVT::i64));
2381-
Ops.push_back(CurDAG->getTargetConstant(OpNode->getAsConstantVal(), DL,
2381+
Ops.push_back(CurDAG->getTargetConstant(OpNode->getAsZExtVal(), DL,
23822382
OpVal.getValueType()));
23832383
} else {
23842384
Ops.push_back(OpVal);
@@ -2449,7 +2449,7 @@ void SelectionDAGISel::Select_PATCHPOINT(SDNode *N) {
24492449
Ops.push_back(*It++);
24502450

24512451
// Push the args for the call.
2452-
for (uint64_t I = NumArgs->getAsConstantVal(); I != 0; I--)
2452+
for (uint64_t I = NumArgs->getAsZExtVal(); I != 0; I--)
24532453
Ops.push_back(*It++);
24542454

24552455
// Now push the live variables.

llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ bool AArch64DAGToDAGISel::SelectArithImmed(SDValue N, SDValue &Val,
580580
if (!isa<ConstantSDNode>(N.getNode()))
581581
return false;
582582

583-
uint64_t Immed = N.getNode()->getAsConstantVal();
583+
uint64_t Immed = N.getNode()->getAsZExtVal();
584584
unsigned ShiftAmt;
585585

586586
if (Immed >> 12 == 0) {
@@ -611,7 +611,7 @@ bool AArch64DAGToDAGISel::SelectNegArithImmed(SDValue N, SDValue &Val,
611611
return false;
612612

613613
// The immediate operand must be a 24-bit zero-extended immediate.
614-
uint64_t Immed = N.getNode()->getAsConstantVal();
614+
uint64_t Immed = N.getNode()->getAsZExtVal();
615615

616616
// This negation is almost always valid, but "cmp wN, #0" and "cmn wN, #0"
617617
// have the opposite effect on the C flag, so this pattern mustn't match under
@@ -1326,7 +1326,7 @@ bool AArch64DAGToDAGISel::SelectAddrModeXRO(SDValue N, unsigned Size,
13261326
// MOV X0, WideImmediate
13271327
// LDR X2, [BaseReg, X0]
13281328
if (isa<ConstantSDNode>(RHS)) {
1329-
int64_t ImmOff = (int64_t)RHS->getAsConstantVal();
1329+
int64_t ImmOff = (int64_t)RHS->getAsZExtVal();
13301330
// Skip the immediate can be selected by load/store addressing mode.
13311331
// Also skip the immediate can be encoded by a single ADD (SUB is also
13321332
// checked by using -ImmOff).

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,7 +3589,7 @@ static SDValue getAArch64Cmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
35893589
// can be turned into:
35903590
// cmp w12, w11, lsl #1
35913591
if (!isa<ConstantSDNode>(RHS) ||
3592-
!isLegalArithImmed(RHS->getAsConstantVal())) {
3592+
!isLegalArithImmed(RHS->getAsZExtVal())) {
35933593
SDValue TheLHS = isCMN(LHS, CC) ? LHS.getOperand(1) : LHS;
35943594

35953595
if (getCmpOperandFoldingProfit(TheLHS) > getCmpOperandFoldingProfit(RHS)) {
@@ -3623,7 +3623,7 @@ static SDValue getAArch64Cmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
36233623
cast<LoadSDNode>(LHS)->getExtensionType() == ISD::ZEXTLOAD &&
36243624
cast<LoadSDNode>(LHS)->getMemoryVT() == MVT::i16 &&
36253625
LHS.getNode()->hasNUsesOfValue(1, 0)) {
3626-
int16_t ValueofRHS = RHS->getAsConstantVal();
3626+
int16_t ValueofRHS = RHS->getAsZExtVal();
36273627
if (ValueofRHS < 0 && isLegalArithImmed(-ValueofRHS)) {
36283628
SDValue SExt =
36293629
DAG.getNode(ISD::SIGN_EXTEND_INREG, dl, LHS.getValueType(), LHS,
@@ -5619,7 +5619,7 @@ SDValue AArch64TargetLowering::LowerMGATHER(SDValue Op,
56195619

56205620
// SVE supports an index scaled by sizeof(MemVT.elt) only, everything else
56215621
// must be calculated before hand.
5622-
uint64_t ScaleVal = Scale->getAsConstantVal();
5622+
uint64_t ScaleVal = Scale->getAsZExtVal();
56235623
if (IsScaled && ScaleVal != MemVT.getScalarStoreSize()) {
56245624
assert(isPowerOf2_64(ScaleVal) && "Expecting power-of-two types");
56255625
EVT IndexVT = Index.getValueType();
@@ -5707,7 +5707,7 @@ SDValue AArch64TargetLowering::LowerMSCATTER(SDValue Op,
57075707

57085708
// SVE supports an index scaled by sizeof(MemVT.elt) only, everything else
57095709
// must be calculated before hand.
5710-
uint64_t ScaleVal = Scale->getAsConstantVal();
5710+
uint64_t ScaleVal = Scale->getAsZExtVal();
57115711
if (IsScaled && ScaleVal != MemVT.getScalarStoreSize()) {
57125712
assert(isPowerOf2_64(ScaleVal) && "Expecting power-of-two types");
57135713
EVT IndexVT = Index.getValueType();
@@ -22011,7 +22011,7 @@ static SDValue performBRCONDCombine(SDNode *N,
2201122011
SDValue Cmp = N->getOperand(3);
2201222012

2201322013
assert(isa<ConstantSDNode>(CCVal) && "Expected a ConstantSDNode here!");
22014-
unsigned CC = CCVal->getAsConstantVal();
22014+
unsigned CC = CCVal->getAsZExtVal();
2201522015
if (CC != AArch64CC::EQ && CC != AArch64CC::NE)
2201622016
return SDValue();
2201722017

llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static SDValue EmitUnrolledSetTag(SelectionDAG &DAG, const SDLoc &dl,
172172
SDValue AArch64SelectionDAGInfo::EmitTargetCodeForSetTag(
173173
SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Addr,
174174
SDValue Size, MachinePointerInfo DstPtrInfo, bool ZeroData) const {
175-
uint64_t ObjSize = Size->getAsConstantVal();
175+
uint64_t ObjSize = Size->getAsZExtVal();
176176
assert(ObjSize % 16 == 0);
177177

178178
MachineFunction &MF = DAG.getMachineFunction();

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ const TargetRegisterClass *AMDGPUDAGToDAGISel::getOperandRegClass(SDNode *N,
382382
Subtarget->getRegisterInfo()->getRegClass(RCID);
383383

384384
SDValue SubRegOp = N->getOperand(OpNo + 1);
385-
unsigned SubRegIdx = SubRegOp->getAsConstantVal();
385+
unsigned SubRegIdx = SubRegOp->getAsZExtVal();
386386
return Subtarget->getRegisterInfo()->getSubClassWithSubReg(SuperRC,
387387
SubRegIdx);
388388
}

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,15 +1651,15 @@ SDValue R600TargetLowering::OptimizeSwizzle(SDValue BuildVector, SDValue Swz[],
16511651

16521652
BuildVector = CompactSwizzlableVector(DAG, BuildVector, SwizzleRemap);
16531653
for (unsigned i = 0; i < 4; i++) {
1654-
unsigned Idx = Swz[i]->getAsConstantVal();
1654+
unsigned Idx = Swz[i]->getAsZExtVal();
16551655
if (SwizzleRemap.contains(Idx))
16561656
Swz[i] = DAG.getConstant(SwizzleRemap[Idx], DL, MVT::i32);
16571657
}
16581658

16591659
SwizzleRemap.clear();
16601660
BuildVector = ReorganizeVector(DAG, BuildVector, SwizzleRemap);
16611661
for (unsigned i = 0; i < 4; i++) {
1662-
unsigned Idx = Swz[i]->getAsConstantVal();
1662+
unsigned Idx = Swz[i]->getAsZExtVal();
16631663
if (SwizzleRemap.contains(Idx))
16641664
Swz[i] = DAG.getConstant(SwizzleRemap[Idx], DL, MVT::i32);
16651665
}
@@ -1780,7 +1780,7 @@ SDValue R600TargetLowering::PerformDAGCombine(SDNode *N,
17801780
// Check that we know which element is being inserted
17811781
if (!isa<ConstantSDNode>(EltNo))
17821782
return SDValue();
1783-
unsigned Elt = EltNo->getAsConstantVal();
1783+
unsigned Elt = EltNo->getAsZExtVal();
17841784

17851785
// Check that the operand is a BUILD_VECTOR (or UNDEF, which can essentially
17861786
// be converted to a BUILD_VECTOR). Fill in the Ops vector with the
@@ -2021,7 +2021,7 @@ bool R600TargetLowering::FoldOperand(SDNode *ParentNode, unsigned SrcIdx,
20212021
}
20222022
case R600::MOV_IMM_GLOBAL_ADDR:
20232023
// Check if the Imm slot is used. Taken from below.
2024-
if (Imm->getAsConstantVal())
2024+
if (Imm->getAsZExtVal())
20252025
return false;
20262026
Imm = Src.getOperand(0);
20272027
Src = DAG.getRegister(R600::ALU_LITERAL_X, MVT::i32);

0 commit comments

Comments
 (0)