[llvm] 8b1d86a - [NFC] Deprecate SelectionDag::getLoad that takes alignment as
Guillaume Chatelet via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 24 01:42:51 PST 2023
Author: Guillaume Chatelet
Date: 2023-01-24T09:42:36Z
New Revision: 8b1d86aedf13a22e283ee334304063febdaec9c7
URL: https://github.com/llvm/llvm-project/commit/8b1d86aedf13a22e283ee334304063febdaec9c7
DIFF: https://github.com/llvm/llvm-project/commit/8b1d86aedf13a22e283ee334304063febdaec9c7.diff
LOG: [NFC] Deprecate SelectionDag::getLoad that takes alignment as
unsigned
Added:
Modified:
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/Sparc/SparcISelLowering.cpp
llvm/lib/Target/VE/VEISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index 491c187ef6e4f..21e2b6ff84584 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -1304,6 +1304,8 @@ class SelectionDAG {
const AAMDNodes &AAInfo = AAMDNodes(),
const MDNode *Ranges = nullptr);
/// FIXME: Remove once transition to Align is over.
+ LLVM_DEPRECATED("Use the getLoad function that takes a MaybeAlign instead",
+ "")
inline SDValue
getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
MachinePointerInfo PtrInfo, unsigned Alignment,
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 356f102085e2d..1ff22429d62dc 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -5447,7 +5447,7 @@ static void prepareDescriptorIndirectCall(SelectionDAG &DAG, SDValue &Callee,
const unsigned EnvPtrOffset = Subtarget.descriptorEnvironmentPointerOffset();
const MVT RegVT = Subtarget.isPPC64() ? MVT::i64 : MVT::i32;
- const unsigned Alignment = Subtarget.isPPC64() ? 8 : 4;
+ const Align Alignment = Subtarget.isPPC64() ? Align(8) : Align(4);
// One load for the functions entry point address.
SDValue LoadFuncPtr = DAG.getLoad(RegVT, dl, LDChain, Callee, MPI,
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index 0672b294d0a58..913f133465b9f 100644
--- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -2718,7 +2718,7 @@ static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) {
// We can't count on greater alignment than the word size.
return DAG.getLoad(
VT, DL, InChain, VAList, MachinePointerInfo(),
- std::min(PtrVT.getFixedSizeInBits(), VT.getFixedSizeInBits()) / 8);
+ Align(std::min(PtrVT.getFixedSizeInBits(), VT.getFixedSizeInBits()) / 8));
}
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG,
diff --git a/llvm/lib/Target/VE/VEISelLowering.cpp b/llvm/lib/Target/VE/VEISelLowering.cpp
index d6b6bc26fd07a..c921f8d43e402 100644
--- a/llvm/lib/Target/VE/VEISelLowering.cpp
+++ b/llvm/lib/Target/VE/VEISelLowering.cpp
@@ -1325,9 +1325,9 @@ static SDValue lowerLoadF128(SDValue Op, SelectionDAG &DAG) {
SDLoc DL(Op);
LoadSDNode *LdNode = dyn_cast<LoadSDNode>(Op.getNode());
assert(LdNode && LdNode->getOffset().isUndef() && "Unexpected node type");
- unsigned Alignment = LdNode->getAlign().value();
+ Align Alignment = LdNode->getAlign();
if (Alignment > 8)
- Alignment = 8;
+ Alignment = Align(8);
SDValue Lo64 =
DAG.getLoad(MVT::f64, DL, LdNode->getChain(), LdNode->getBasePtr(),
@@ -1372,9 +1372,9 @@ static SDValue lowerLoadI1(SDValue Op, SelectionDAG &DAG) {
assert(LdNode && LdNode->getOffset().isUndef() && "Unexpected node type");
SDValue BasePtr = LdNode->getBasePtr();
- unsigned Alignment = LdNode->getAlign().value();
+ Align Alignment = LdNode->getAlign();
if (Alignment > 8)
- Alignment = 8;
+ Alignment = Align(8);
EVT AddrVT = BasePtr.getValueType();
EVT MemVT = LdNode->getMemoryVT();
@@ -1632,8 +1632,9 @@ SDValue VETargetLowering::lowerVAARG(SDValue Op, SelectionDAG &DAG) const {
// Load the actual argument out of the pointer VAList.
// We can't count on greater alignment than the word size.
- return DAG.getLoad(VT, DL, InChain, VAList, MachinePointerInfo(),
- std::min(PtrVT.getSizeInBits(), VT.getSizeInBits()) / 8);
+ return DAG.getLoad(
+ VT, DL, InChain, VAList, MachinePointerInfo(),
+ Align(std::min(PtrVT.getSizeInBits(), VT.getSizeInBits()) / 8));
}
SDValue VETargetLowering::lowerDYNAMIC_STACKALLOC(SDValue Op,
More information about the llvm-commits
mailing list