]> granicus.if.org Git - llvm/commitdiff
[Alignment][NFC] TargetCallingConv::setByValAlign
authorGuillaume Chatelet <gchatelet@google.com>
Mon, 21 Oct 2019 12:05:33 +0000 (12:05 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 21 Oct 2019 12:05:33 +0000 (12:05 +0000)
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

include/llvm/CodeGen/TargetCallingConv.h
lib/CodeGen/GlobalISel/CallLowering.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 4b59b7c514f49fd7735e4c85dd0af390ce4ef10c..db3d1175afee438b312845b6be2ca7f2c09d92cc 100644 (file)
@@ -125,9 +125,9 @@ namespace ISD {
       MaybeAlign A = decodeMaybeAlign(ByValAlign);
       return A ? A->value() : 0;
     }
-    void setByValAlign(unsigned A) {
-      ByValAlign = encode(Align(A));
-      assert(getByValAlign() == A && "bitfield overflow");
+    void setByValAlign(Align A) {
+      ByValAlign = encode(A);
+      assert(getByValAlign() == A.value() && "bitfield overflow");
     }
 
     unsigned getOrigAlign() const {
index 4d47ee3cbb49347494b8e939a0a336323c976856..cdad92f7db4fef3bc1c3d3258be74fe8221ac8f6 100644 (file)
@@ -106,7 +106,7 @@ void CallLowering::setArgFlags(CallLowering::ArgInfo &Arg, unsigned OpIdx,
       FrameAlign = FuncInfo.getParamAlignment(OpIdx - 2);
     else
       FrameAlign = getTLI()->getByValTypeAlignment(ElementTy, DL);
-    Flags.setByValAlign(FrameAlign);
+    Flags.setByValAlign(Align(FrameAlign));
   }
   if (Attrs.hasAttribute(OpIdx, Attribute::Nest))
     Flags.setNest();
index c9521eda1a7e847dd416233eb35400386aeb2edd..6d7260d7aee5c4dd9c853af969b045c1ae8b6f1f 100644 (file)
@@ -1213,7 +1213,7 @@ bool FastISel::lowerCallTo(CallLoweringInfo &CLI) {
       if (!FrameAlign)
         FrameAlign = TLI.getByValTypeAlignment(ElementTy, DL);
       Flags.setByValSize(FrameSize);
-      Flags.setByValAlign(FrameAlign);
+      Flags.setByValAlign(Align(FrameAlign));
     }
     if (Arg.IsNest)
       Flags.setNest();
index dee9a9be0e59dd8fab2c73e84eef0558289a6bb9..8c15563fcd23d44930a02fa64ecd98c3f1e7e68f 100644 (file)
@@ -9164,7 +9164,7 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const {
           FrameAlign = Args[i].Alignment;
         else
           FrameAlign = getByValTypeAlignment(ElementTy, DL);
-        Flags.setByValAlign(FrameAlign);
+        Flags.setByValAlign(Align(FrameAlign));
       }
       if (Args[i].IsNest)
         Flags.setNest();
@@ -9668,7 +9668,7 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
           FrameAlign = Arg.getParamAlignment();
         else
           FrameAlign = TLI->getByValTypeAlignment(ElementTy, DL);
-        Flags.setByValAlign(FrameAlign);
+        Flags.setByValAlign(Align(FrameAlign));
       }
       if (Arg.hasAttribute(Attribute::Nest))
         Flags.setNest();