Skip to content

Commit 355cc3f

Browse files
committed
[NFC] Deprecate SelectionDag functions taking Alignment as unsigned
1 parent 02371c5 commit 355cc3f

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,8 @@ class SelectionDAG {
13461346
Ranges);
13471347
}
13481348
/// FIXME: Remove once transition to Align is over.
1349+
LLVM_DEPRECATED("Use the getLoad function that takes a MaybeAlign instead",
1350+
"")
13491351
inline SDValue
13501352
getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT,
13511353
const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset,
@@ -1380,6 +1382,7 @@ class SelectionDAG {
13801382
MMOFlags, AAInfo);
13811383
}
13821384
/// FIXME: Remove once transition to Align is over.
1385+
LLVM_DEPRECATED("Use the version that takes a MaybeAlign instead", "")
13831386
inline SDValue
13841387
getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
13851388
MachinePointerInfo PtrInfo, unsigned Alignment,
@@ -1406,6 +1409,7 @@ class SelectionDAG {
14061409
AAInfo);
14071410
}
14081411
/// FIXME: Remove once transition to Align is over.
1412+
LLVM_DEPRECATED("Use the version that takes a MaybeAlign instead", "")
14091413
inline SDValue
14101414
getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
14111415
MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment,

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ SDValue R600TargetLowering::LowerFormalArguments(
15111511
// size of the register which isn't useful.
15121512

15131513
unsigned PartOffset = VA.getLocMemOffset();
1514-
unsigned Alignment = MinAlign(VT.getStoreSize(), PartOffset);
1514+
Align Alignment = commonAlignment(Align(VT.getStoreSize()), PartOffset);
15151515

15161516
MachinePointerInfo PtrInfo(AMDGPUAS::PARAM_I_ADDRESS);
15171517
SDValue Arg = DAG.getLoad(

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16590,7 +16590,7 @@ static SDValue PerformSplittingToNarrowingStores(StoreSDNode *St,
1659016590

1659116591
SDValue Store = DAG.getTruncStore(
1659216592
Ch, DL, Extract, NewPtr, St->getPointerInfo().getWithOffset(NewOffset),
16593-
NewToVT, Alignment.value(), MMOFlags, AAInfo);
16593+
NewToVT, Alignment, MMOFlags, AAInfo);
1659416594
Stores.push_back(Store);
1659516595
}
1659616596
return DAG.getNode(ISD::TokenFactor, DL, MVT::Other, Stores);
@@ -16631,7 +16631,7 @@ static SDValue PerformSplittingMVETruncToNarrowingStores(StoreSDNode *St,
1663116631
SDValue Extract = Trunc.getOperand(i);
1663216632
SDValue Store = DAG.getTruncStore(
1663316633
Ch, DL, Extract, NewPtr, St->getPointerInfo().getWithOffset(NewOffset),
16634-
NewToVT, Alignment.value(), MMOFlags, AAInfo);
16634+
NewToVT, Alignment, MMOFlags, AAInfo);
1663516635
Stores.push_back(Store);
1663616636
}
1663716637
return DAG.getNode(ISD::TokenFactor, DL, MVT::Other, Stores);
@@ -16667,8 +16667,8 @@ static SDValue PerformExtractFpToIntStores(StoreSDNode *St, SelectionDAG &DAG) {
1666716667
AAMDNodes AAInfo = St->getAAInfo();
1666816668
EVT NewToVT = EVT::getIntegerVT(C, VT.getSizeInBits());
1666916669
SDValue Store = DAG.getTruncStore(Ch, DL, SDValue(GetLane, 0), BasePtr,
16670-
St->getPointerInfo(), NewToVT,
16671-
Alignment.value(), MMOFlags, AAInfo);
16670+
St->getPointerInfo(), NewToVT, Alignment,
16671+
MMOFlags, AAInfo);
1667216672

1667316673
return Store;
1667416674
}

llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ SDValue SystemZSelectionDAGInfo::EmitTargetCodeForMemcpy(
7676
// MVI, MVHHI, MVHI and MVGHI respectively.
7777
static SDValue memsetStore(SelectionDAG &DAG, const SDLoc &DL, SDValue Chain,
7878
SDValue Dst, uint64_t ByteVal, uint64_t Size,
79-
unsigned Align, MachinePointerInfo DstPtrInfo) {
79+
Align Alignment, MachinePointerInfo DstPtrInfo) {
8080
uint64_t StoreVal = ByteVal;
8181
for (unsigned I = 1; I < Size; ++I)
8282
StoreVal |= ByteVal << (I * 8);
8383
return DAG.getStore(
8484
Chain, DL, DAG.getConstant(StoreVal, DL, MVT::getIntegerVT(Size * 8)),
85-
Dst, DstPtrInfo, Align);
85+
Dst, DstPtrInfo, Alignment);
8686
}
8787

8888
SDValue SystemZSelectionDAGInfo::EmitTargetCodeForMemset(
@@ -111,15 +111,15 @@ SDValue SystemZSelectionDAGInfo::EmitTargetCodeForMemset(
111111
unsigned Size1 = Bytes == 16 ? 8 : 1 << findLastSet(Bytes);
112112
unsigned Size2 = Bytes - Size1;
113113
SDValue Chain1 = memsetStore(DAG, DL, Chain, Dst, ByteVal, Size1,
114-
Alignment.value(), DstPtrInfo);
114+
Alignment, DstPtrInfo);
115115
if (Size2 == 0)
116116
return Chain1;
117117
Dst = DAG.getNode(ISD::ADD, DL, PtrVT, Dst,
118118
DAG.getConstant(Size1, DL, PtrVT));
119119
DstPtrInfo = DstPtrInfo.getWithOffset(Size1);
120-
SDValue Chain2 = memsetStore(
121-
DAG, DL, Chain, Dst, ByteVal, Size2,
122-
std::min((unsigned)Alignment.value(), Size1), DstPtrInfo);
120+
SDValue Chain2 =
121+
memsetStore(DAG, DL, Chain, Dst, ByteVal, Size2,
122+
std::min(Alignment, Align(Size1)), DstPtrInfo);
123123
return DAG.getNode(ISD::TokenFactor, DL, MVT::Other, Chain1, Chain2);
124124
}
125125
} else {

llvm/lib/Target/VE/VEISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,9 +1464,9 @@ static SDValue lowerStoreF128(SDValue Op, SelectionDAG &DAG) {
14641464
SDNode *Lo64 = DAG.getMachineNode(TargetOpcode::EXTRACT_SUBREG, DL, MVT::i64,
14651465
StNode->getValue(), SubRegOdd);
14661466

1467-
unsigned Alignment = StNode->getAlign().value();
1467+
Align Alignment = StNode->getAlign();
14681468
if (Alignment > 8)
1469-
Alignment = 8;
1469+
Alignment = Align(8);
14701470

14711471
// VE stores Hi64 to 8(addr) and Lo64 to 0(addr)
14721472
SDValue OutChains[2];
@@ -1498,9 +1498,9 @@ static SDValue lowerStoreI1(SDValue Op, SelectionDAG &DAG) {
14981498
assert(StNode && StNode->getOffset().isUndef() && "Unexpected node type");
14991499

15001500
SDValue BasePtr = StNode->getBasePtr();
1501-
unsigned Alignment = StNode->getAlign().value();
1501+
Align Alignment = StNode->getAlign();
15021502
if (Alignment > 8)
1503-
Alignment = 8;
1503+
Alignment = Align(8);
15041504
EVT AddrVT = BasePtr.getValueType();
15051505
EVT MemVT = StNode->getMemoryVT();
15061506
if (MemVT == MVT::v256i1 || MemVT == MVT::v4i64) {

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29186,7 +29186,7 @@ SDValue X86TargetLowering::LowerSET_ROUNDING(SDValue Op,
2918629186

2918729187
// Update rounding mode bits and store the new FP Control Word into stack.
2918829188
CWD = DAG.getNode(ISD::OR, DL, MVT::i16, CWD, RMBits);
29189-
Chain = DAG.getStore(Chain, DL, CWD, StackSlot, MPI, /* Alignment = */ 2);
29189+
Chain = DAG.getStore(Chain, DL, CWD, StackSlot, MPI, Align(2));
2919029190

2919129191
// Load FP control word from the slot.
2919229192
SDValue OpsLD[] = {Chain, StackSlot};
@@ -29217,7 +29217,7 @@ SDValue X86TargetLowering::LowerSET_ROUNDING(SDValue Op,
2921729217

2921829218
// Update rounding mode bits and store the new FP Control Word into stack.
2921929219
CWD = DAG.getNode(ISD::OR, DL, MVT::i32, CWD, RMBits);
29220-
Chain = DAG.getStore(Chain, DL, CWD, StackSlot, MPI, /* Alignment = */ 4);
29220+
Chain = DAG.getStore(Chain, DL, CWD, StackSlot, MPI, Align(4));
2922129221

2922229222
// Load MXCSR from the slot.
2922329223
Chain = DAG.getNode(

0 commit comments

Comments
 (0)