[llvm] r375084 - [Alignment][NFC] Use Align for TargetFrameLowering/Subtarget

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 13:49:04 PDT 2019


Hi Galina,

I haven't been able to reproduce these errors locally on master. Are you
sure they come from my patch?

Cheers,
Guillaume

On Fri, Oct 18, 2019 at 11:52 PM Galina Kistanova <gkistanova at gmail.com>
wrote:

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


More information about the llvm-commits mailing list