<div dir="ltr">Hi Galina,<div><br></div><div>I haven't been able to reproduce these errors locally on master. Are you sure they come from my patch?</div><div><br></div><div>Cheers,</div><div>Guillaume</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 18, 2019 at 11:52 PM Galina Kistanova <<a href="mailto:gkistanova@gmail.com">gkistanova@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello Guillaume,<br><br>It looks like this commit broke few tests to the builder:<br><a href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win</a><br><br><div>. . .</div>Failing Tests (3):<br>    LLVM :: CodeGen/AMDGPU/GlobalISel/inst-select-fabs.mir<br>    LLVM :: CodeGen/AMDGPU/GlobalISel/inst-select-fneg.mir<br>    LLVM :: ExecutionEngine/JITLink/X86/MachO_zero_fill_alignment.s  <br><br>Please have a look?<br><br>Thanks<br><br>Galina</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 17, 2019 at 12:47 AM Guillaume Chatelet via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: gchatelet<br>
Date: Thu Oct 17 00:49:39 2019<br>
New Revision: 375084<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=375084&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=375084&view=rev</a><br>
Log:<br>
[Alignment][NFC] Use Align for TargetFrameLowering/Subtarget<br>
<br>
Summary:<br>
This is patch is part of a series to introduce an Alignment type.<br>
See this thread for context: <a href="http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html" rel="noreferrer" target="_blank">http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html</a><br>
See this patch for the introduction of the type: <a href="https://reviews.llvm.org/D64790" rel="noreferrer" target="_blank">https://reviews.llvm.org/D64790</a><br>
<br>
Reviewers: courbet<br>
<br>
Subscribers: jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, llvm-commits<br>
<br>
Tags: #llvm<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D68993" rel="noreferrer" target="_blank">https://reviews.llvm.org/D68993</a><br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/CodeGen/TargetFrameLowering.h<br>
    llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.h<br>
    llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp<br>
    llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.h<br>
    llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h<br>
    llvm/trunk/lib/Target/AMDGPU/R600FrameLowering.h<br>
    llvm/trunk/lib/Target/AMDGPU/SIFrameLowering.h<br>
    llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp<br>
    llvm/trunk/lib/Target/ARC/ARCFrameLowering.h<br>
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp<br>
    llvm/trunk/lib/Target/ARM/ARMSubtarget.h<br>
    llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp<br>
    llvm/trunk/lib/Target/BPF/BPFFrameLowering.h<br>
    llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.h<br>
    llvm/trunk/lib/Target/Lanai/LanaiFrameLowering.h<br>
    llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h<br>
    llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp<br>
    llvm/trunk/lib/Target/Mips/MipsFrameLowering.h<br>
    llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp<br>
    llvm/trunk/lib/Target/Mips/MipsSubtarget.h<br>
    llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp<br>
    llvm/trunk/lib/Target/NVPTX/NVPTXFrameLowering.cpp<br>
    llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp<br>
    llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h<br>
    llvm/trunk/lib/Target/RISCV/RISCVFrameLowering.h<br>
    llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp<br>
    llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp<br>
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.h<br>
    llvm/trunk/lib/Target/X86/X86FrameLowering.cpp<br>
    llvm/trunk/lib/Target/X86/X86FrameLowering.h<br>
    llvm/trunk/lib/Target/X86/X86Subtarget.cpp<br>
    llvm/trunk/lib/Target/X86/X86Subtarget.h<br>
    llvm/trunk/lib/Target/X86/X86TargetMachine.cpp<br>
    llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp<br>
    llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/TargetFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/TargetFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/TargetFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/TargetFrameLowering.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/TargetFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -54,15 +54,15 @@ public:<br>
   };<br>
 private:<br>
   StackDirection StackDir;<br>
-  unsigned StackAlignment;<br>
+  Align StackAlignment;<br>
   unsigned TransientStackAlignment;<br>
   int LocalAreaOffset;<br>
   bool StackRealignable;<br>
 public:<br>
-  TargetFrameLowering(StackDirection D, unsigned StackAl, int LAO,<br>
+  TargetFrameLowering(StackDirection D, Align StackAl, int LAO,<br>
                       unsigned TransAl = 1, bool StackReal = true)<br>
-    : StackDir(D), StackAlignment(StackAl), TransientStackAlignment(TransAl),<br>
-      LocalAreaOffset(LAO), StackRealignable(StackReal) {}<br>
+      : StackDir(D), StackAlignment(StackAl), TransientStackAlignment(TransAl),<br>
+        LocalAreaOffset(LAO), StackRealignable(StackReal) {}<br>
<br>
   virtual ~TargetFrameLowering();<br>
<br>
@@ -77,7 +77,7 @@ public:<br>
   /// stack pointer must be aligned on entry to a function.  Typically, this<br>
   /// is the largest alignment for any data object in the target.<br>
   ///<br>
-  unsigned getStackAlignment() const { return StackAlignment; }<br>
+  unsigned getStackAlignment() const { return StackAlignment.value(); }<br>
<br>
   /// alignSPAdjust - This method aligns the stack adjustment to the correct<br>
   /// alignment.<br>
<br>
Modified: llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -21,7 +21,7 @@ namespace llvm {<br>
 class AArch64FrameLowering : public TargetFrameLowering {<br>
 public:<br>
   explicit AArch64FrameLowering()<br>
-      : TargetFrameLowering(StackGrowsDown, 16, 0, 16,<br>
+      : TargetFrameLowering(StackGrowsDown, Align(16), 0, 16,<br>
                             true /*StackRealignable*/) {}<br>
<br>
   void emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,<br>
<br>
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -13,9 +13,9 @@<br>
 #include "AMDGPUFrameLowering.h"<br>
<br>
 using namespace llvm;<br>
-AMDGPUFrameLowering::AMDGPUFrameLowering(StackDirection D, unsigned StackAl,<br>
-    int LAO, unsigned TransAl)<br>
-  : TargetFrameLowering(D, StackAl, LAO, TransAl) { }<br>
+AMDGPUFrameLowering::AMDGPUFrameLowering(StackDirection D, Align StackAl,<br>
+                                         int LAO, unsigned TransAl)<br>
+    : TargetFrameLowering(D, StackAl, LAO, TransAl) {}<br>
<br>
 AMDGPUFrameLowering::~AMDGPUFrameLowering() = default;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -25,7 +25,7 @@ namespace llvm {<br>
 /// See TargetFrameInfo for more comments.<br>
 class AMDGPUFrameLowering : public TargetFrameLowering {<br>
 public:<br>
-  AMDGPUFrameLowering(StackDirection D, unsigned StackAl, int LAO,<br>
+  AMDGPUFrameLowering(StackDirection D, Align StackAl, int LAO,<br>
                       unsigned TransAl = 1);<br>
   ~AMDGPUFrameLowering() override;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h (original)<br>
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h Thu Oct 17 00:49:39 2019<br>
@@ -866,9 +866,7 @@ public:<br>
   // on the pointer value itself may rely on the alignment / known low bits of<br>
   // the pointer. Set this to something above the minimum to avoid needing<br>
   // dynamic realignment in common cases.<br>
-  unsigned getStackAlignment() const {<br>
-    return 16;<br>
-  }<br>
+  Align getStackAlignment() const { return Align(16); }<br>
<br>
   bool enableMachineScheduler() const override {<br>
     return true;<br>
@@ -1257,9 +1255,7 @@ public:<br>
     return Gen;<br>
   }<br>
<br>
-  unsigned getStackAlignment() const {<br>
-    return 4;<br>
-  }<br>
+  Align getStackAlignment() const { return Align(4); }<br>
<br>
   R600Subtarget &initializeSubtargetDependencies(const Triple &TT,<br>
                                                  StringRef GPU, StringRef FS);<br>
<br>
Modified: llvm/trunk/lib/Target/AMDGPU/R600FrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AMDGPU/R600FrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/AMDGPU/R600FrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -15,9 +15,9 @@ namespace llvm {<br>
<br>
 class R600FrameLowering : public AMDGPUFrameLowering {<br>
 public:<br>
-  R600FrameLowering(StackDirection D, unsigned StackAl, int LAO,<br>
-                    unsigned TransAl = 1) :<br>
-    AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}<br>
+  R600FrameLowering(StackDirection D, Align StackAl, int LAO,<br>
+                    unsigned TransAl = 1)<br>
+      : AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}<br>
   ~R600FrameLowering() override;<br>
<br>
   void emitPrologue(MachineFunction &MF,<br>
<br>
Modified: llvm/trunk/lib/Target/AMDGPU/SIFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AMDGPU/SIFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/AMDGPU/SIFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -20,9 +20,9 @@ class GCNSubtarget;<br>
<br>
 class SIFrameLowering final : public AMDGPUFrameLowering {<br>
 public:<br>
-  SIFrameLowering(StackDirection D, unsigned StackAl, int LAO,<br>
-                  unsigned TransAl = 1) :<br>
-    AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}<br>
+  SIFrameLowering(StackDirection D, Align StackAl, int LAO,<br>
+                  unsigned TransAl = 1)<br>
+      : AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}<br>
   ~SIFrameLowering() override = default;<br>
<br>
   void emitEntryFunctionPrologue(MachineFunction &MF,<br>
<br>
Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -2816,7 +2816,7 @@ SDValue SITargetLowering::LowerCall(Call<br>
       int32_t Offset = LocMemOffset;<br>
<br>
       SDValue PtrOff = DAG.getConstant(Offset, DL, PtrVT);<br>
-      unsigned Align = 0;<br>
+      MaybeAlign Alignment;<br>
<br>
       if (IsTailCall) {<br>
         ISD::ArgFlagsTy Flags = Outs[realArgIdx].Flags;<br>
@@ -2824,8 +2824,10 @@ SDValue SITargetLowering::LowerCall(Call<br>
           Flags.getByValSize() : VA.getValVT().getStoreSize();<br>
<br>
         // FIXME: We can have better than the minimum byval required alignment.<br>
-        Align = Flags.isByVal() ? Flags.getByValAlign() :<br>
-          MinAlign(Subtarget->getStackAlignment(), Offset);<br>
+        Alignment =<br>
+            Flags.isByVal()<br>
+                ? MaybeAlign(Flags.getByValAlign())<br>
+                : commonAlignment(Subtarget->getStackAlignment(), Offset);<br>
<br>
         Offset = Offset + FPDiff;<br>
         int FI = MFI.CreateFixedObject(OpSize, Offset, true);<br>
@@ -2844,7 +2846,8 @@ SDValue SITargetLowering::LowerCall(Call<br>
       } else {<br>
         DstAddr = PtrOff;<br>
         DstInfo = MachinePointerInfo::getStack(MF, LocMemOffset);<br>
-        Align = MinAlign(Subtarget->getStackAlignment(), LocMemOffset);<br>
+        Alignment =<br>
+            commonAlignment(Subtarget->getStackAlignment(), LocMemOffset);<br>
       }<br>
<br>
       if (Outs[i].Flags.isByVal()) {<br>
@@ -2859,7 +2862,8 @@ SDValue SITargetLowering::LowerCall(Call<br>
<br>
         MemOpChains.push_back(Cpy);<br>
       } else {<br>
-        SDValue Store = DAG.getStore(Chain, DL, Arg, DstAddr, DstInfo, Align);<br>
+        SDValue Store = DAG.getStore(Chain, DL, Arg, DstAddr, DstInfo,<br>
+                                     Alignment ? Alignment->value() : 0);<br>
         MemOpChains.push_back(Store);<br>
       }<br>
     }<br>
<br>
Modified: llvm/trunk/lib/Target/ARC/ARCFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/ARCFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/ARCFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARC/ARCFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/ARC/ARCFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -27,8 +27,8 @@ class ARCInstrInfo;<br>
 class ARCFrameLowering : public TargetFrameLowering {<br>
 public:<br>
   ARCFrameLowering(const ARCSubtarget &st)<br>
-      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 4, 0), ST(st) {<br>
-  }<br>
+      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(4), 0),<br>
+        ST(st) {}<br>
<br>
   /// Insert Prologue into the function.<br>
   void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Thu Oct 17 00:49:39 2019<br>
@@ -205,9 +205,9 @@ void ARMSubtarget::initSubtargetFeatures<br>
     NoARM = true;<br>
<br>
   if (isAAPCS_ABI())<br>
-    stackAlignment = 8;<br>
+    stackAlignment = Align(8);<br>
   if (isTargetNaCl() || isAAPCS16_ABI())<br>
-    stackAlignment = 16;<br>
+    stackAlignment = Align(16);<br>
<br>
   // FIXME: Completely disable sibcall for Thumb1 since ThumbRegisterInfo::<br>
   // emitEpilogue is not ready for them. Thumb tail calls also use t2B, as<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.h (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.h Thu Oct 17 00:49:39 2019<br>
@@ -449,7 +449,7 @@ protected:<br>
<br>
   /// stackAlignment - The minimum alignment known to hold of the stack frame on<br>
   /// entry to the function and which must be maintained by every function.<br>
-  unsigned stackAlignment = 4;<br>
+  Align stackAlignment = Align(4);<br>
<br>
   /// CPUString - String name of used CPU.<br>
   std::string CPUString;<br>
@@ -816,7 +816,7 @@ public:<br>
   /// getStackAlignment - Returns the minimum alignment known to hold of the<br>
   /// stack frame on entry to the function and which must be maintained by every<br>
   /// function for this subtarget.<br>
-  unsigned getStackAlignment() const { return stackAlignment; }<br>
+  Align getStackAlignment() const { return stackAlignment; }<br>
<br>
   unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/AVR/AVRFrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -30,7 +30,8 @@<br>
 namespace llvm {<br>
<br>
 AVRFrameLowering::AVRFrameLowering()<br>
-    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 1, -2) {}<br>
+    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align::None(),<br>
+                          -2) {}<br>
<br>
 bool AVRFrameLowering::canSimplifyCallFramePseudos(<br>
     const MachineFunction &MF) const {<br>
<br>
Modified: llvm/trunk/lib/Target/BPF/BPFFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/BPF/BPFFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/BPF/BPFFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -21,7 +21,7 @@ class BPFSubtarget;<br>
 class BPFFrameLowering : public TargetFrameLowering {<br>
 public:<br>
   explicit BPFFrameLowering(const BPFSubtarget &sti)<br>
-      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0) {}<br>
+      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(8), 0) {}<br>
<br>
   void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;<br>
   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;<br>
<br>
Modified: llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -30,7 +30,7 @@ class TargetRegisterClass;<br>
 class HexagonFrameLowering : public TargetFrameLowering {<br>
 public:<br>
   explicit HexagonFrameLowering()<br>
-      : TargetFrameLowering(StackGrowsDown, 8, 0, 1, true) {}<br>
+      : TargetFrameLowering(StackGrowsDown, Align(8), 0, 1, true) {}<br>
<br>
   // All of the prolog/epilog functionality, including saving and restoring<br>
   // callee-saved registers is handled in emitPrologue. This is to have the<br>
<br>
Modified: llvm/trunk/lib/Target/Lanai/LanaiFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Lanai/LanaiFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Lanai/LanaiFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Lanai/LanaiFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/Lanai/LanaiFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -31,7 +31,7 @@ protected:<br>
 public:<br>
   explicit LanaiFrameLowering(const LanaiSubtarget &Subtarget)<br>
       : TargetFrameLowering(StackGrowsDown,<br>
-                            /*StackAlignment=*/8,<br>
+                            /*StackAlignment=*/Align(8),<br>
                             /*LocalAreaOffset=*/0),<br>
         STI(Subtarget) {}<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -22,7 +22,8 @@ protected:<br>
<br>
 public:<br>
   explicit MSP430FrameLowering()<br>
-      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2, 2) {}<br>
+      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(2), -2,<br>
+                            2) {}<br>
<br>
   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into<br>
   /// the function.<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Thu Oct 17 00:49:39 2019<br>
@@ -781,7 +781,7 @@ void MipsAsmPrinter::EmitStartOfAsmFile(<br>
   StringRef CPU = MIPS_MC::selectMipsCPU(TT, TM.getTargetCPU());<br>
   StringRef FS = TM.getTargetFeatureString();<br>
   const MipsTargetMachine &MTM = static_cast<const MipsTargetMachine &>(TM);<br>
-  const MipsSubtarget STI(TT, CPU, FS, MTM.isLittleEndian(), MTM, 0);<br>
+  const MipsSubtarget STI(TT, CPU, FS, MTM.isLittleEndian(), MTM, None);<br>
<br>
   bool IsABICalls = STI.isABICalls();<br>
   const MipsABIInfo &ABI = MTM.getABI();<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MipsFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MipsFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/Mips/MipsFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -24,8 +24,9 @@ protected:<br>
   const MipsSubtarget &STI;<br>
<br>
 public:<br>
-  explicit MipsFrameLowering(const MipsSubtarget &sti, unsigned Alignment)<br>
-    : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment), STI(sti) {}<br>
+  explicit MipsFrameLowering(const MipsSubtarget &sti, Align Alignment)<br>
+      : TargetFrameLowering(StackGrowsDown, Alignment, 0, Alignment.value()),<br>
+        STI(sti) {}<br>
<br>
   static const MipsFrameLowering *create(const MipsSubtarget &ST);<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp Thu Oct 17 00:49:39 2019<br>
@@ -69,7 +69,7 @@ void MipsSubtarget::anchor() {}<br>
<br>
 MipsSubtarget::MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS,<br>
                              bool little, const MipsTargetMachine &TM,<br>
-                             unsigned StackAlignOverride)<br>
+                             MaybeAlign StackAlignOverride)<br>
     : MipsGenSubtargetInfo(TT, CPU, FS), MipsArchVersion(MipsDefault),<br>
       IsLittle(little), IsSoftFloat(false), IsSingleFloat(false), IsFPXX(false),<br>
       NoABICalls(false), Abs2008(false), IsFP64bit(false), UseOddSPReg(true),<br>
@@ -81,10 +81,9 @@ MipsSubtarget::MipsSubtarget(const Tripl<br>
       Os16(Mips_Os16), HasMSA(false), UseTCCInDIV(false), HasSym32(false),<br>
       HasEVA(false), DisableMadd4(false), HasMT(false), HasCRC(false),<br>
       HasVirt(false), HasGINV(false), UseIndirectJumpsHazard(false),<br>
-      StackAlignOverride(StackAlignOverride),<br>
-      TM(TM), TargetTriple(TT), TSInfo(),<br>
-      InstrInfo(<br>
-          MipsInstrInfo::create(initializeSubtargetDependencies(CPU, FS, TM))),<br>
+      StackAlignOverride(StackAlignOverride), TM(TM), TargetTriple(TT),<br>
+      TSInfo(), InstrInfo(MipsInstrInfo::create(<br>
+                    initializeSubtargetDependencies(CPU, FS, TM))),<br>
       FrameLowering(MipsFrameLowering::create(*this)),<br>
       TLInfo(MipsTargetLowering::create(TM, *this)) {<br>
<br>
@@ -248,12 +247,12 @@ MipsSubtarget::initializeSubtargetDepend<br>
     InMips16HardFloat = true;<br>
<br>
   if (StackAlignOverride)<br>
-    stackAlignment = StackAlignOverride;<br>
+    stackAlignment = *StackAlignOverride;<br>
   else if (isABI_N32() || isABI_N64())<br>
-    stackAlignment = 16;<br>
+    stackAlignment = Align(16);<br>
   else {<br>
     assert(isABI_O32() && "Unknown ABI for stack alignment!");<br>
-    stackAlignment = 8;<br>
+    stackAlignment = Align(8);<br>
   }<br>
<br>
   return *this;<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MipsSubtarget.h (original)<br>
+++ llvm/trunk/lib/Target/Mips/MipsSubtarget.h Thu Oct 17 00:49:39 2019<br>
@@ -194,10 +194,10 @@ class MipsSubtarget : public MipsGenSubt<br>
<br>
   /// The minimum alignment known to hold of the stack frame on<br>
   /// entry to the function and which must be maintained by every function.<br>
-  unsigned stackAlignment;<br>
+  Align stackAlignment;<br>
<br>
   /// The overridden stack alignment.<br>
-  unsigned StackAlignOverride;<br>
+  MaybeAlign StackAlignOverride;<br>
<br>
   InstrItineraryData InstrItins;<br>
<br>
@@ -230,7 +230,7 @@ public:<br>
   /// This constructor initializes the data members to match that<br>
   /// of the specified triple.<br>
   MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS, bool little,<br>
-                const MipsTargetMachine &TM, unsigned StackAlignOverride);<br>
+                const MipsTargetMachine &TM, MaybeAlign StackAlignOverride);<br>
<br>
   /// ParseSubtargetFeatures - Parses features string setting specified<br>
   /// subtarget options.  Definition of function is auto generated by tblgen.<br>
@@ -349,7 +349,7 @@ public:<br>
   // really use them if in addition we are in mips16 mode<br>
   static bool useConstantIslands();<br>
<br>
-  unsigned getStackAlignment() const { return stackAlignment; }<br>
+  Align getStackAlignment() const { return stackAlignment; }<br>
<br>
   // Grab relocation model<br>
   Reloc::Model getRelocationModel() const;<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Thu Oct 17 00:49:39 2019<br>
@@ -119,12 +119,15 @@ MipsTargetMachine::MipsTargetMachine(con<br>
                         getEffectiveCodeModel(CM, CodeModel::Small), OL),<br>
       isLittle(isLittle), TLOF(std::make_unique<MipsTargetObjectFile>()),<br>
       ABI(MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions)),<br>
-      Subtarget(nullptr), DefaultSubtarget(TT, CPU, FS, isLittle, *this,<br>
-                                           Options.StackAlignmentOverride),<br>
+      Subtarget(nullptr),<br>
+      DefaultSubtarget(TT, CPU, FS, isLittle, *this,<br>
+                       MaybeAlign(Options.StackAlignmentOverride)),<br>
       NoMips16Subtarget(TT, CPU, FS.empty() ? "-mips16" : FS.str() + ",-mips16",<br>
-                        isLittle, *this, Options.StackAlignmentOverride),<br>
+                        isLittle, *this,<br>
+                        MaybeAlign(Options.StackAlignmentOverride)),<br>
       Mips16Subtarget(TT, CPU, FS.empty() ? "+mips16" : FS.str() + ",+mips16",<br>
-                      isLittle, *this, Options.StackAlignmentOverride) {<br>
+                      isLittle, *this,<br>
+                      MaybeAlign(Options.StackAlignmentOverride)) {<br>
   Subtarget = &DefaultSubtarget;<br>
   initAsmInfo();<br>
 }<br>
@@ -196,8 +199,9 @@ MipsTargetMachine::getSubtargetImpl(cons<br>
     // creation will depend on the TM and the code generation flags on the<br>
     // function that reside in TargetOptions.<br>
     resetTargetOptions(F);<br>
-    I = std::make_unique<MipsSubtarget>(TargetTriple, CPU, FS, isLittle, *this,<br>
-                                         Options.StackAlignmentOverride);<br>
+    I = std::make_unique<MipsSubtarget>(<br>
+        TargetTriple, CPU, FS, isLittle, *this,<br>
+        MaybeAlign(Options.StackAlignmentOverride));<br>
   }<br>
   return I.get();<br>
 }<br>
<br>
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXFrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/NVPTX/NVPTXFrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/NVPTX/NVPTXFrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -25,7 +25,7 @@<br>
 using namespace llvm;<br>
<br>
 NVPTXFrameLowering::NVPTXFrameLowering()<br>
-    : TargetFrameLowering(TargetFrameLowering::StackGrowsUp, 8, 0) {}<br>
+    : TargetFrameLowering(TargetFrameLowering::StackGrowsUp, Align(8), 0) {}<br>
<br>
 bool NVPTXFrameLowering::hasFP(const MachineFunction &MF) const { return true; }<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp Thu Oct 17 00:49:39 2019<br>
@@ -60,7 +60,7 @@ PPCSubtarget::PPCSubtarget(const Triple<br>
       InstrInfo(*this), TLInfo(TM, *this) {}<br>
<br>
 void PPCSubtarget::initializeEnvironment() {<br>
-  StackAlignment = 16;<br>
+  StackAlignment = Align(16);<br>
   DarwinDirective = PPC::DIR_NONE;<br>
   HasMFOCRF = false;<br>
   Has64BitSupport = false;<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h Thu Oct 17 00:49:39 2019<br>
@@ -78,7 +78,7 @@ protected:<br>
<br>
   /// stackAlignment - The minimum alignment known to hold of the stack frame on<br>
   /// entry to the function and which must be maintained by every function.<br>
-  unsigned StackAlignment;<br>
+  Align StackAlignment;<br>
<br>
   /// Selected instruction itineraries (one entry per itinerary class.)<br>
   InstrItineraryData InstrItins;<br>
@@ -166,7 +166,7 @@ public:<br>
   /// getStackAlignment - Returns the minimum alignment known to hold of the<br>
   /// stack frame on entry to the function and which must be maintained by every<br>
   /// function for this subtarget.<br>
-  unsigned getStackAlignment() const { return StackAlignment; }<br>
+  Align getStackAlignment() const { return StackAlignment; }<br>
<br>
   /// getDarwinDirective - Returns the -m directive specified for the cpu.<br>
   ///<br>
@@ -281,11 +281,11 @@ public:<br>
   bool hasDirectMove() const { return HasDirectMove; }<br>
<br>
   bool isQPXStackUnaligned() const { return IsQPXStackUnaligned; }<br>
-  unsigned getPlatformStackAlignment() const {<br>
+  Align getPlatformStackAlignment() const {<br>
     if ((hasQPX() || isBGQ()) && !isQPXStackUnaligned())<br>
-      return 32;<br>
+      return Align(32);<br>
<br>
-    return 16;<br>
+    return Align(16);<br>
   }<br>
<br>
   // DarwinABI has a 224-byte red zone. PPC32 SVR4ABI(Non-DarwinABI) has no<br>
<br>
Modified: llvm/trunk/lib/Target/RISCV/RISCVFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/RISCV/RISCVFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/RISCV/RISCVFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/RISCV/RISCVFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/RISCV/RISCVFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -22,7 +22,7 @@ class RISCVFrameLowering : public Target<br>
 public:<br>
   explicit RISCVFrameLowering(const RISCVSubtarget &STI)<br>
       : TargetFrameLowering(StackGrowsDown,<br>
-                            /*StackAlignment=*/16,<br>
+                            /*StackAlignment=*/Align(16),<br>
                             /*LocalAreaOffset=*/0),<br>
         STI(STI) {}<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -34,7 +34,8 @@ DisableLeafProc("disable-sparc-leaf-proc<br>
<br>
 SparcFrameLowering::SparcFrameLowering(const SparcSubtarget &ST)<br>
     : TargetFrameLowering(TargetFrameLowering::StackGrowsDown,<br>
-                          ST.is64Bit() ? 16 : 8, 0, ST.is64Bit() ? 16 : 8) {}<br>
+                          ST.is64Bit() ? Align(16) : Align(8), 0,<br>
+                          ST.is64Bit() ? 16 : 8) {}<br>
<br>
 void SparcFrameLowering::emitSPAdjustment(MachineFunction &MF,<br>
                                           MachineBasicBlock &MBB,<br>
<br>
Modified: llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/SystemZ/SystemZFrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -46,7 +46,7 @@ static const TargetFrameLowering::SpillS<br>
 } // end anonymous namespace<br>
<br>
 SystemZFrameLowering::SystemZFrameLowering()<br>
-    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8,<br>
+    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(8),<br>
                           -SystemZMC::CallFrameSize, 8,<br>
                           false /* StackRealignable */) {<br>
   // Create a mapping from register number to save slot offset.<br>
<br>
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -29,7 +29,7 @@ public:<br>
   static const size_t RedZoneSize = 128;<br>
<br>
   WebAssemblyFrameLowering()<br>
-      : TargetFrameLowering(StackGrowsDown, /*StackAlignment=*/16,<br>
+      : TargetFrameLowering(StackGrowsDown, /*StackAlignment=*/Align(16),<br>
                             /*LocalAreaOffset=*/0,<br>
                             /*TransientStackAlignment=*/16,<br>
                             /*StackRealignable=*/true) {}<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -35,8 +35,8 @@<br>
 using namespace llvm;<br>
<br>
 X86FrameLowering::X86FrameLowering(const X86Subtarget &STI,<br>
-                                   unsigned StackAlignOverride)<br>
-    : TargetFrameLowering(StackGrowsDown, StackAlignOverride,<br>
+                                   MaybeAlign StackAlignOverride)<br>
+    : TargetFrameLowering(StackGrowsDown, StackAlignOverride.valueOrOne(),<br>
                           STI.is64Bit() ? -8 : -4),<br>
       STI(STI), TII(*STI.getInstrInfo()), TRI(STI.getRegisterInfo()) {<br>
   // Cache a bunch of frame-related predicates for this subtarget.<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86FrameLowering.h (original)<br>
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.h Thu Oct 17 00:49:39 2019<br>
@@ -25,7 +25,7 @@ class X86RegisterInfo;<br>
<br>
 class X86FrameLowering : public TargetFrameLowering {<br>
 public:<br>
-  X86FrameLowering(const X86Subtarget &STI, unsigned StackAlignOverride);<br>
+  X86FrameLowering(const X86Subtarget &STI, MaybeAlign StackAlignOverride);<br>
<br>
   // Cached subtarget predicates.<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Thu Oct 17 00:49:39 2019<br>
@@ -288,10 +288,10 @@ void X86Subtarget::initSubtargetFeatures<br>
   // Stack alignment is 16 bytes on Darwin, Linux, kFreeBSD and Solaris (both<br>
   // 32 and 64 bit) and for all 64-bit targets.<br>
   if (StackAlignOverride)<br>
-    stackAlignment = StackAlignOverride;<br>
+    stackAlignment = *StackAlignOverride;<br>
   else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||<br>
            isTargetKFreeBSD() || In64BitMode)<br>
-    stackAlignment = 16;<br>
+    stackAlignment = Align(16);<br>
<br>
   // Some CPUs have more overhead for gather. The specified overhead is relative<br>
   // to the Load operation. "2" is the number provided by Intel architects. This<br>
@@ -321,12 +321,11 @@ X86Subtarget &X86Subtarget::initializeSu<br>
<br>
 X86Subtarget::X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS,<br>
                            const X86TargetMachine &TM,<br>
-                           unsigned StackAlignOverride,<br>
+                           MaybeAlign StackAlignOverride,<br>
                            unsigned PreferVectorWidthOverride,<br>
                            unsigned RequiredVectorWidth)<br>
-    : X86GenSubtargetInfo(TT, CPU, FS),<br>
-      PICStyle(PICStyles::None), TM(TM), TargetTriple(TT),<br>
-      StackAlignOverride(StackAlignOverride),<br>
+    : X86GenSubtargetInfo(TT, CPU, FS), PICStyle(PICStyles::None), TM(TM),<br>
+      TargetTriple(TT), StackAlignOverride(StackAlignOverride),<br>
       PreferVectorWidthOverride(PreferVectorWidthOverride),<br>
       RequiredVectorWidth(RequiredVectorWidth),<br>
       In64BitMode(TargetTriple.getArch() == Triple::x86_64),<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)<br>
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Thu Oct 17 00:49:39 2019<br>
@@ -432,7 +432,7 @@ protected:<br>
<br>
   /// The minimum alignment known to hold of the stack frame on<br>
   /// entry to the function and which must be maintained by every function.<br>
-  unsigned stackAlignment = 4;<br>
+  Align stackAlignment = Align(4);<br>
<br>
   /// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.<br>
   ///<br>
@@ -459,7 +459,7 @@ protected:<br>
<br>
 private:<br>
   /// Override the stack alignment.<br>
-  unsigned StackAlignOverride;<br>
+  MaybeAlign StackAlignOverride;<br>
<br>
   /// Preferred vector width from function attribute.<br>
   unsigned PreferVectorWidthOverride;<br>
@@ -496,7 +496,7 @@ public:<br>
   /// of the specified triple.<br>
   ///<br>
   X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS,<br>
-               const X86TargetMachine &TM, unsigned StackAlignOverride,<br>
+               const X86TargetMachine &TM, MaybeAlign StackAlignOverride,<br>
                unsigned PreferVectorWidthOverride,<br>
                unsigned RequiredVectorWidth);<br>
<br>
@@ -521,7 +521,7 @@ public:<br>
   /// Returns the minimum alignment known to hold of the<br>
   /// stack frame on entry to the function and which must be maintained by every<br>
   /// function for this subtarget.<br>
-  unsigned getStackAlignment() const { return stackAlignment; }<br>
+  Align getStackAlignment() const { return stackAlignment; }<br>
<br>
   /// Returns the maximum memset / memcpy size<br>
   /// that still makes it profitable to inline the call.<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Thu Oct 17 00:49:39 2019<br>
@@ -307,10 +307,10 @@ X86TargetMachine::getSubtargetImpl(const<br>
     // creation will depend on the TM and the code generation flags on the<br>
     // function that reside in TargetOptions.<br>
     resetTargetOptions(F);<br>
-    I = std::make_unique<X86Subtarget>(TargetTriple, CPU, FS, *this,<br>
-                                        Options.StackAlignmentOverride,<br>
-                                        PreferVectorWidthOverride,<br>
-                                        RequiredVectorWidth);<br>
+    I = std::make_unique<X86Subtarget>(<br>
+        TargetTriple, CPU, FS, *this,<br>
+        MaybeAlign(Options.StackAlignmentOverride), PreferVectorWidthOverride,<br>
+        RequiredVectorWidth);<br>
   }<br>
   return I.get();<br>
 }<br>
<br>
Modified: llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp Thu Oct 17 00:49:39 2019<br>
@@ -211,7 +211,7 @@ static void RestoreSpillList(MachineBasi<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 XCoreFrameLowering::XCoreFrameLowering(const XCoreSubtarget &sti)<br>
-  : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 4, 0) {<br>
+    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(4), 0) {<br>
   // Do nothing<br>
 }<br>
<br>
<br>
Modified: llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp?rev=375084&r1=375083&r2=375084&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp?rev=375084&r1=375083&r2=375084&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp (original)<br>
+++ llvm/trunk/unittests/CodeGen/MachineInstrTest.cpp Thu Oct 17 00:49:39 2019<br>
@@ -35,7 +35,7 @@ public:<br>
 class BogusFrameLowering : public TargetFrameLowering {<br>
 public:<br>
   BogusFrameLowering()<br>
-      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 4, 4) {}<br>
+      : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(4), 4) {}<br>
<br>
   void emitPrologue(MachineFunction &MF,<br>
                     MachineBasicBlock &MBB) const override {}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>