Skip to content

Commit

Permalink
[X86] getTargetConstantPoolFromBasePtr - drop const qualifier
Browse files Browse the repository at this point in the history
Return ConstantPoolSDNode instead of const ConstantPoolSDNode - doesn't affect the accessors at all and makes it easier to use result in calls expecting a SDNode.
  • Loading branch information
RKSimon committed Dec 20, 2023
1 parent 52820bd commit 3974d89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4554,15 +4554,15 @@ static SDValue getShuffleVectorZeroOrUndef(SDValue V2, int Idx,
return DAG.getVectorShuffle(VT, SDLoc(V2), V1, V2, MaskVec);
}

static const ConstantPoolSDNode *getTargetConstantPoolFromBasePtr(SDValue Ptr) {
static ConstantPoolSDNode *getTargetConstantPoolFromBasePtr(SDValue Ptr) {
if (Ptr.getOpcode() == X86ISD::Wrapper ||
Ptr.getOpcode() == X86ISD::WrapperRIP)
Ptr = Ptr.getOperand(0);
return dyn_cast<ConstantPoolSDNode>(Ptr);
}

static const Constant *getTargetConstantFromBasePtr(SDValue Ptr) {
const ConstantPoolSDNode *CNode = getTargetConstantPoolFromBasePtr(Ptr);
ConstantPoolSDNode *CNode = getTargetConstantPoolFromBasePtr(Ptr);
if (!CNode || CNode->isMachineConstantPoolEntry() || CNode->getOffset() != 0)
return nullptr;
return CNode->getConstVal();
Expand Down

0 comments on commit 3974d89

Please sign in to comment.