mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
[SelectionDAG] Remove ConstantPoolSDNode::getAlignment.
Use getAlign instead. Differential Revision: https://reviews.llvm.org/D79459
This commit is contained in:
parent
6cffa34898
commit
0eaa558f63
@ -1855,8 +1855,6 @@ public:
|
||||
// Return the alignment of this constant pool object, which is either 0 (for
|
||||
// default alignment) or the desired value.
|
||||
Align getAlign() const { return Alignment; }
|
||||
// TODO: Remove once transition to getAlign is over.
|
||||
unsigned getAlignment() const { return Alignment.value(); }
|
||||
unsigned getTargetFlags() const { return TargetFlags; }
|
||||
|
||||
Type *getType() const;
|
||||
|
@ -413,23 +413,14 @@ void InstrEmitter::AddOperand(MachineInstrBuilder &MIB,
|
||||
MIB.addJumpTableIndex(JT->getIndex(), JT->getTargetFlags());
|
||||
} else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Op)) {
|
||||
int Offset = CP->getOffset();
|
||||
unsigned Align = CP->getAlignment();
|
||||
Type *Type = CP->getType();
|
||||
// MachineConstantPool wants an explicit alignment.
|
||||
if (Align == 0) {
|
||||
Align = MF->getDataLayout().getPrefTypeAlignment(Type);
|
||||
if (Align == 0) {
|
||||
// Alignment of vector types. FIXME!
|
||||
Align = MF->getDataLayout().getTypeAllocSize(Type);
|
||||
}
|
||||
}
|
||||
Align Alignment = CP->getAlign();
|
||||
|
||||
unsigned Idx;
|
||||
MachineConstantPool *MCP = MF->getConstantPool();
|
||||
if (CP->isMachineConstantPoolEntry())
|
||||
Idx = MCP->getConstantPoolIndex(CP->getMachineCPVal(), Align);
|
||||
Idx = MCP->getConstantPoolIndex(CP->getMachineCPVal(), Alignment.value());
|
||||
else
|
||||
Idx = MCP->getConstantPoolIndex(CP->getConstVal(), Align);
|
||||
Idx = MCP->getConstantPoolIndex(CP->getConstVal(), Alignment.value());
|
||||
MIB.addConstantPoolIndex(Idx, Offset, CP->getTargetFlags());
|
||||
} else if (ExternalSymbolSDNode *ES = dyn_cast<ExternalSymbolSDNode>(Op)) {
|
||||
MIB.addExternalSymbol(ES->getSymbol(), ES->getTargetFlags());
|
||||
|
@ -328,7 +328,7 @@ SelectionDAGLegalize::ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP) {
|
||||
|
||||
SDValue CPIdx =
|
||||
DAG.getConstantPool(LLVMC, TLI.getPointerTy(DAG.getDataLayout()));
|
||||
unsigned Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlignment();
|
||||
Align Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlign();
|
||||
if (Extend) {
|
||||
SDValue Result = DAG.getExtLoad(
|
||||
ISD::EXTLOAD, dl, OrigVT, DAG.getEntryNode(), CPIdx,
|
||||
@ -348,7 +348,7 @@ SDValue SelectionDAGLegalize::ExpandConstant(ConstantSDNode *CP) {
|
||||
EVT VT = CP->getValueType(0);
|
||||
SDValue CPIdx = DAG.getConstantPool(CP->getConstantIntValue(),
|
||||
TLI.getPointerTy(DAG.getDataLayout()));
|
||||
unsigned Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlignment();
|
||||
Align Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlign();
|
||||
SDValue Result = DAG.getLoad(
|
||||
VT, dl, DAG.getEntryNode(), CPIdx,
|
||||
MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), Alignment);
|
||||
@ -1964,7 +1964,7 @@ SDValue SelectionDAGLegalize::ExpandBUILD_VECTOR(SDNode *Node) {
|
||||
Constant *CP = ConstantVector::get(CV);
|
||||
SDValue CPIdx =
|
||||
DAG.getConstantPool(CP, TLI.getPointerTy(DAG.getDataLayout()));
|
||||
unsigned Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlignment();
|
||||
Align Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlign();
|
||||
return DAG.getLoad(
|
||||
VT, dl, DAG.getEntryNode(), CPIdx,
|
||||
MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
|
||||
@ -2505,9 +2505,9 @@ SDValue SelectionDAGLegalize::ExpandLegalINT_TO_FP(SDNode *Node,
|
||||
|
||||
SDValue CPIdx =
|
||||
DAG.getConstantPool(FudgeFactor, TLI.getPointerTy(DAG.getDataLayout()));
|
||||
unsigned Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlignment();
|
||||
Align Alignment = cast<ConstantPoolSDNode>(CPIdx)->getAlign();
|
||||
CPIdx = DAG.getNode(ISD::ADD, dl, CPIdx.getValueType(), CPIdx, CstOffset);
|
||||
Alignment = std::min(Alignment, 4u);
|
||||
Alignment = commonAlignment(Alignment, 4);
|
||||
SDValue FudgeInReg;
|
||||
if (DestVT == MVT::f32)
|
||||
FudgeInReg = DAG.getLoad(
|
||||
|
@ -2483,7 +2483,7 @@ def alignedglobal : PatLeaf<(iPTR iPTR:$label), [{
|
||||
return Align && *Align >= 4 && G->getOffset() % 4 == 0;
|
||||
}
|
||||
if (auto *C = dyn_cast<ConstantPoolSDNode>(N))
|
||||
return C->getAlignment() >= 4 && C->getOffset() % 4 == 0;
|
||||
return C->getAlign() >= 4 && C->getOffset() % 4 == 0;
|
||||
return false;
|
||||
}]>;
|
||||
|
||||
|
@ -146,7 +146,7 @@ bool MSP430DAGToDAGISel::MatchWrapper(SDValue N, MSP430ISelAddressMode &AM) {
|
||||
//AM.SymbolFlags = G->getTargetFlags();
|
||||
} else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(N0)) {
|
||||
AM.CP = CP->getConstVal();
|
||||
AM.Align = CP->getAlignment();
|
||||
AM.Align = CP->getAlign().value();
|
||||
AM.Disp += CP->getOffset();
|
||||
//AM.SymbolFlags = CP->getTargetFlags();
|
||||
} else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(N0)) {
|
||||
|
@ -1625,7 +1625,7 @@ bool X86DAGToDAGISel::matchWrapper(SDValue N, X86ISelAddressMode &AM) {
|
||||
Offset = G->getOffset();
|
||||
} else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(N0)) {
|
||||
AM.CP = CP->getConstVal();
|
||||
AM.Align = CP->getAlignment();
|
||||
AM.Align = CP->getAlign().value();
|
||||
AM.SymbolFlags = CP->getTargetFlags();
|
||||
Offset = CP->getOffset();
|
||||
} else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(N0)) {
|
||||
|
@ -8694,7 +8694,7 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
|
||||
SDValue CP = DAG.getConstantPool(C, PVT);
|
||||
unsigned Repeat = VT.getSizeInBits() / SplatBitSize;
|
||||
|
||||
Align Alignment(cast<ConstantPoolSDNode>(CP)->getAlignment());
|
||||
Align Alignment = cast<ConstantPoolSDNode>(CP)->getAlign();
|
||||
SDVTList Tys =
|
||||
DAG.getVTList(MVT::getVectorVT(CVT, Repeat), MVT::Other);
|
||||
SDValue Ops[] = {DAG.getEntryNode(), CP};
|
||||
@ -8712,7 +8712,7 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
|
||||
*Ctx);
|
||||
SDValue VCP = DAG.getConstantPool(VecC, PVT);
|
||||
unsigned NumElm = SplatBitSize / VT.getScalarSizeInBits();
|
||||
Align Alignment(cast<ConstantPoolSDNode>(VCP)->getAlignment());
|
||||
Align Alignment = cast<ConstantPoolSDNode>(VCP)->getAlign();
|
||||
Ld = DAG.getLoad(
|
||||
MVT::getVectorVT(CVT, NumElm), dl, DAG.getEntryNode(), VCP,
|
||||
MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
|
||||
@ -8782,7 +8782,7 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
|
||||
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
|
||||
SDValue CP =
|
||||
DAG.getConstantPool(C, TLI.getPointerTy(DAG.getDataLayout()));
|
||||
Align Alignment(cast<ConstantPoolSDNode>(CP)->getAlignment());
|
||||
Align Alignment = cast<ConstantPoolSDNode>(CP)->getAlign();
|
||||
|
||||
SDVTList Tys = DAG.getVTList(VT, MVT::Other);
|
||||
SDValue Ops[] = {DAG.getEntryNode(), CP};
|
||||
@ -19910,7 +19910,7 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op,
|
||||
APInt FF(64, 0x5F80000000000000ULL);
|
||||
SDValue FudgePtr = DAG.getConstantPool(
|
||||
ConstantInt::get(*DAG.getContext(), FF), PtrVT);
|
||||
Align CPAlignment(cast<ConstantPoolSDNode>(FudgePtr)->getAlignment());
|
||||
Align CPAlignment = cast<ConstantPoolSDNode>(FudgePtr)->getAlign();
|
||||
|
||||
// Get a pointer to FF if the sign bit was set, or to 0 otherwise.
|
||||
SDValue Zero = DAG.getIntPtrConstant(0, dl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user