Skip to content

Commit 8b1d86a

Browse files
committed
[NFC] Deprecate SelectionDag::getLoad that takes alignment as
unsigned
1 parent d595b59 commit 8b1d86a

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

+2
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,8 @@ class SelectionDAG {
13041304
const AAMDNodes &AAInfo = AAMDNodes(),
13051305
const MDNode *Ranges = nullptr);
13061306
/// FIXME: Remove once transition to Align is over.
1307+
LLVM_DEPRECATED("Use the getLoad function that takes a MaybeAlign instead",
1308+
"")
13071309
inline SDValue
13081310
getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
13091311
MachinePointerInfo PtrInfo, unsigned Alignment,

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5447,7 +5447,7 @@ static void prepareDescriptorIndirectCall(SelectionDAG &DAG, SDValue &Callee,
54475447
const unsigned EnvPtrOffset = Subtarget.descriptorEnvironmentPointerOffset();
54485448

54495449
const MVT RegVT = Subtarget.isPPC64() ? MVT::i64 : MVT::i32;
5450-
const unsigned Alignment = Subtarget.isPPC64() ? 8 : 4;
5450+
const Align Alignment = Subtarget.isPPC64() ? Align(8) : Align(4);
54515451

54525452
// One load for the functions entry point address.
54535453
SDValue LoadFuncPtr = DAG.getLoad(RegVT, dl, LDChain, Callee, MPI,

llvm/lib/Target/Sparc/SparcISelLowering.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) {
27182718
// We can't count on greater alignment than the word size.
27192719
return DAG.getLoad(
27202720
VT, DL, InChain, VAList, MachinePointerInfo(),
2721-
std::min(PtrVT.getFixedSizeInBits(), VT.getFixedSizeInBits()) / 8);
2721+
Align(std::min(PtrVT.getFixedSizeInBits(), VT.getFixedSizeInBits()) / 8));
27222722
}
27232723

27242724
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG,

llvm/lib/Target/VE/VEISelLowering.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -1325,9 +1325,9 @@ static SDValue lowerLoadF128(SDValue Op, SelectionDAG &DAG) {
13251325
SDLoc DL(Op);
13261326
LoadSDNode *LdNode = dyn_cast<LoadSDNode>(Op.getNode());
13271327
assert(LdNode && LdNode->getOffset().isUndef() && "Unexpected node type");
1328-
unsigned Alignment = LdNode->getAlign().value();
1328+
Align Alignment = LdNode->getAlign();
13291329
if (Alignment > 8)
1330-
Alignment = 8;
1330+
Alignment = Align(8);
13311331

13321332
SDValue Lo64 =
13331333
DAG.getLoad(MVT::f64, DL, LdNode->getChain(), LdNode->getBasePtr(),
@@ -1372,9 +1372,9 @@ static SDValue lowerLoadI1(SDValue Op, SelectionDAG &DAG) {
13721372
assert(LdNode && LdNode->getOffset().isUndef() && "Unexpected node type");
13731373

13741374
SDValue BasePtr = LdNode->getBasePtr();
1375-
unsigned Alignment = LdNode->getAlign().value();
1375+
Align Alignment = LdNode->getAlign();
13761376
if (Alignment > 8)
1377-
Alignment = 8;
1377+
Alignment = Align(8);
13781378

13791379
EVT AddrVT = BasePtr.getValueType();
13801380
EVT MemVT = LdNode->getMemoryVT();
@@ -1632,8 +1632,9 @@ SDValue VETargetLowering::lowerVAARG(SDValue Op, SelectionDAG &DAG) const {
16321632

16331633
// Load the actual argument out of the pointer VAList.
16341634
// We can't count on greater alignment than the word size.
1635-
return DAG.getLoad(VT, DL, InChain, VAList, MachinePointerInfo(),
1636-
std::min(PtrVT.getSizeInBits(), VT.getSizeInBits()) / 8);
1635+
return DAG.getLoad(
1636+
VT, DL, InChain, VAList, MachinePointerInfo(),
1637+
Align(std::min(PtrVT.getSizeInBits(), VT.getSizeInBits()) / 8));
16371638
}
16381639

16391640
SDValue VETargetLowering::lowerDYNAMIC_STACKALLOC(SDValue Op,

0 commit comments

Comments
 (0)