Skip to content

Commit 0e61c30

Browse files
committed
[Alignment][NFC] TargetCallingConv::setByValAlign
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69248 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375410 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 91d68c5 commit 0e61c30

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

include/llvm/CodeGen/TargetCallingConv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ namespace ISD {
125125
MaybeAlign A = decodeMaybeAlign(ByValAlign);
126126
return A ? A->value() : 0;
127127
}
128-
void setByValAlign(unsigned A) {
129-
ByValAlign = encode(Align(A));
130-
assert(getByValAlign() == A && "bitfield overflow");
128+
void setByValAlign(Align A) {
129+
ByValAlign = encode(A);
130+
assert(getByValAlign() == A.value() && "bitfield overflow");
131131
}
132132

133133
unsigned getOrigAlign() const {

lib/CodeGen/GlobalISel/CallLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void CallLowering::setArgFlags(CallLowering::ArgInfo &Arg, unsigned OpIdx,
106106
FrameAlign = FuncInfo.getParamAlignment(OpIdx - 2);
107107
else
108108
FrameAlign = getTLI()->getByValTypeAlignment(ElementTy, DL);
109-
Flags.setByValAlign(FrameAlign);
109+
Flags.setByValAlign(Align(FrameAlign));
110110
}
111111
if (Attrs.hasAttribute(OpIdx, Attribute::Nest))
112112
Flags.setNest();

lib/CodeGen/SelectionDAG/FastISel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ bool FastISel::lowerCallTo(CallLoweringInfo &CLI) {
12131213
if (!FrameAlign)
12141214
FrameAlign = TLI.getByValTypeAlignment(ElementTy, DL);
12151215
Flags.setByValSize(FrameSize);
1216-
Flags.setByValAlign(FrameAlign);
1216+
Flags.setByValAlign(Align(FrameAlign));
12171217
}
12181218
if (Arg.IsNest)
12191219
Flags.setNest();

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9164,7 +9164,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
91649164
FrameAlign = Args[i].Alignment;
91659165
else
91669166
FrameAlign = getByValTypeAlignment(ElementTy, DL);
9167-
Flags.setByValAlign(FrameAlign);
9167+
Flags.setByValAlign(Align(FrameAlign));
91689168
}
91699169
if (Args[i].IsNest)
91709170
Flags.setNest();
@@ -9668,7 +9668,7 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
96689668
FrameAlign = Arg.getParamAlignment();
96699669
else
96709670
FrameAlign = TLI->getByValTypeAlignment(ElementTy, DL);
9671-
Flags.setByValAlign(FrameAlign);
9671+
Flags.setByValAlign(Align(FrameAlign));
96729672
}
96739673
if (Arg.hasAttribute(Attribute::Nest))
96749674
Flags.setNest();

0 commit comments

Comments
 (0)