Skip to content

Commit

Permalink
[Alignment][NFC] Remove unneeded llvm:: scoping on Align types
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373081 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
gchatelet committed Sep 27, 2019
1 parent cc0761d commit 71864c0
Show file tree
Hide file tree
Showing 94 changed files with 434 additions and 453 deletions.
12 changes: 6 additions & 6 deletions include/llvm/Analysis/TargetTransformInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ class TargetTransformInfo {
bool isLegalMaskedLoad(Type *DataType) const;

/// Return true if the target supports nontemporal store.
bool isLegalNTStore(Type *DataType, llvm::Align Alignment) const;
bool isLegalNTStore(Type *DataType, Align Alignment) const;
/// Return true if the target supports nontemporal load.
bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) const;
bool isLegalNTLoad(Type *DataType, Align Alignment) const;

/// Return true if the target supports masked scatter.
bool isLegalMaskedScatter(Type *DataType) const;
Expand Down Expand Up @@ -1196,8 +1196,8 @@ class TargetTransformInfo::Concept {
virtual bool shouldFavorBackedgeIndex(const Loop *L) const = 0;
virtual bool isLegalMaskedStore(Type *DataType) = 0;
virtual bool isLegalMaskedLoad(Type *DataType) = 0;
virtual bool isLegalNTStore(Type *DataType, llvm::Align Alignment) = 0;
virtual bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) = 0;
virtual bool isLegalNTStore(Type *DataType, Align Alignment) = 0;
virtual bool isLegalNTLoad(Type *DataType, Align Alignment) = 0;
virtual bool isLegalMaskedScatter(Type *DataType) = 0;
virtual bool isLegalMaskedGather(Type *DataType) = 0;
virtual bool isLegalMaskedCompressStore(Type *DataType) = 0;
Expand Down Expand Up @@ -1471,10 +1471,10 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
bool isLegalMaskedLoad(Type *DataType) override {
return Impl.isLegalMaskedLoad(DataType);
}
bool isLegalNTStore(Type *DataType, llvm::Align Alignment) override {
bool isLegalNTStore(Type *DataType, Align Alignment) override {
return Impl.isLegalNTStore(DataType, Alignment);
}
bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) override {
bool isLegalNTLoad(Type *DataType, Align Alignment) override {
return Impl.isLegalNTLoad(DataType, Alignment);
}
bool isLegalMaskedScatter(Type *DataType) override {
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/Analysis/TargetTransformInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ class TargetTransformInfoImplBase {

bool isLegalMaskedLoad(Type *DataType) { return false; }

bool isLegalNTStore(Type *DataType, llvm::Align Alignment) {
bool isLegalNTStore(Type *DataType, Align Alignment) {
// By default, assume nontemporal memory stores are available for stores
// that are aligned and have a size that is a power of 2.
unsigned DataSize = DL.getTypeStoreSize(DataType);
return Alignment >= DataSize && isPowerOf2_32(DataSize);
}

bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) {
bool isLegalNTLoad(Type *DataType, Align Alignment) {
// By default, assume nontemporal memory loads are available for loads that
// are aligned and have a size that is a power of 2.
unsigned DataSize = DL.getTypeStoreSize(DataType);
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/CodeGen/AsmPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class AsmPrinter : public MachineFunctionPass {
/// global value is specified, and if that global has an explicit alignment
/// requested, it will override the alignment request if required for
/// correctness.
void EmitAlignment(llvm::Align Align, const GlobalObject *GV = nullptr) const;
void EmitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;

/// Lower the specified LLVM Constant to an MCExpr.
virtual const MCExpr *lowerConstant(const Constant *CV);
Expand Down Expand Up @@ -643,8 +643,8 @@ class AsmPrinter : public MachineFunctionPass {
void EmitLinkage(const GlobalValue *GV, MCSymbol *GVSym) const;

/// Return the alignment for the specified \p GV.
static llvm::Align getGVAlignment(const GlobalValue *GV, const DataLayout &DL,
llvm::Align InAlign = llvm::Align::None());
static Align getGVAlignment(const GlobalValue *GV, const DataLayout &DL,
Align InAlign = Align::None());

private:
/// Private state for PrintSpecial()
Expand Down
12 changes: 6 additions & 6 deletions include/llvm/CodeGen/CallingConvLower.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,18 +424,18 @@ class CCState {
/// AllocateStack - Allocate a chunk of stack space with the specified size
/// and alignment.
unsigned AllocateStack(unsigned Size, unsigned Alignment) {
const llvm::Align Align(Alignment);
StackOffset = alignTo(StackOffset, Align);
const Align CheckedAlignment(Alignment);
StackOffset = alignTo(StackOffset, CheckedAlignment);
unsigned Result = StackOffset;
StackOffset += Size;
MaxStackArgAlign = std::max(Align, MaxStackArgAlign);
ensureMaxAlignment(Align);
MaxStackArgAlign = std::max(CheckedAlignment, MaxStackArgAlign);
ensureMaxAlignment(CheckedAlignment);
return Result;
}

void ensureMaxAlignment(llvm::Align Align) {
void ensureMaxAlignment(Align Alignment) {
if (!AnalyzingMustTailForwardedRegs)
MF.getFrameInfo().ensureMaxAlignment(Align.value());
MF.getFrameInfo().ensureMaxAlignment(Alignment.value());
}

/// Version of AllocateStack with extra register to be shadowed.
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/CodeGen/MachineBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class MachineBasicBlock

/// Alignment of the basic block. One if the basic block does not need to be
/// aligned.
llvm::Align Alignment;
Align Alignment;

/// Indicate that this basic block is entered via an exception handler.
bool IsEHPad = false;
Expand Down Expand Up @@ -373,10 +373,10 @@ class MachineBasicBlock
const uint32_t *getEndClobberMask(const TargetRegisterInfo *TRI) const;

/// Return alignment of the basic block.
llvm::Align getAlignment() const { return Alignment; }
Align getAlignment() const { return Alignment; }

/// Set alignment of the basic block.
void setAlignment(llvm::Align A) { Alignment = A; }
void setAlignment(Align A) { Alignment = A; }

/// Returns true if the block is a landing pad. That is this basic block is
/// entered via an exception handler.
Expand Down
21 changes: 11 additions & 10 deletions include/llvm/CodeGen/MachineFrameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class MachineFrameInfo {

uint8_t SSPLayout;

StackObject(uint64_t Size, llvm::Align Alignment, int64_t SPOffset,
StackObject(uint64_t Size, Align Alignment, int64_t SPOffset,
bool IsImmutable, bool IsSpillSlot, const AllocaInst *Alloca,
bool IsAliased, uint8_t StackID = 0)
: SPOffset(SPOffset), Size(Size), Alignment(Alignment),
Expand Down Expand Up @@ -419,7 +419,9 @@ class MachineFrameInfo {

/// Required alignment of the local object blob,
/// which is the strictest alignment of any object in it.
void setLocalFrameMaxAlign(Align Align) { LocalFrameMaxAlign = Align; }
void setLocalFrameMaxAlign(Align Alignment) {
LocalFrameMaxAlign = Alignment;
}

/// Return the required alignment of the local object blob.
Align getLocalFrameMaxAlign() const { return LocalFrameMaxAlign; }
Expand Down Expand Up @@ -564,7 +566,7 @@ class MachineFrameInfo {
unsigned getMaxAlignment() const { return MaxAlignment.value(); }

/// Make sure the function is at least Align bytes aligned.
void ensureMaxAlignment(llvm::Align Align);
void ensureMaxAlignment(Align Alignment);
/// FIXME: Remove this once transition to Align is over.
inline void ensureMaxAlignment(unsigned Align) {
ensureMaxAlignment(assumeAligned(Align));
Expand Down Expand Up @@ -732,9 +734,9 @@ class MachineFrameInfo {

/// Create a new statically sized stack object, returning
/// a nonnegative identifier to represent it.
int CreateStackObject(uint64_t Size, llvm::Align Alignment, bool isSpillSlot,
int CreateStackObject(uint64_t Size, Align Alignment, bool isSpillSlot,
const AllocaInst *Alloca = nullptr, uint8_t ID = 0);
/// FIXME: Remove this function when transition to llvm::Align is over.
/// FIXME: Remove this function when transition to Align is over.
inline int CreateStackObject(uint64_t Size, unsigned Alignment,
bool isSpillSlot,
const AllocaInst *Alloca = nullptr,
Expand All @@ -745,8 +747,8 @@ class MachineFrameInfo {

/// Create a new statically sized stack object that represents a spill slot,
/// returning a nonnegative identifier to represent it.
int CreateSpillStackObject(uint64_t Size, llvm::Align Alignment);
/// FIXME: Remove this function when transition to llvm::Align is over.
int CreateSpillStackObject(uint64_t Size, Align Alignment);
/// FIXME: Remove this function when transition to Align is over.
inline int CreateSpillStackObject(uint64_t Size, unsigned Alignment) {
return CreateSpillStackObject(Size, assumeAligned(Alignment));
}
Expand All @@ -760,9 +762,8 @@ class MachineFrameInfo {
/// Notify the MachineFrameInfo object that a variable sized object has been
/// created. This must be created whenever a variable sized object is
/// created, whether or not the index returned is actually used.
int CreateVariableSizedObject(llvm::Align Alignment,
const AllocaInst *Alloca);
/// FIXME: Remove this function when transition to llvm::Align is over.
int CreateVariableSizedObject(Align Alignment, const AllocaInst *Alloca);
/// FIXME: Remove this function when transition to Align is over.
int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca) {
return CreateVariableSizedObject(assumeAligned(Alignment), Alloca);
}
Expand Down
8 changes: 4 additions & 4 deletions include/llvm/CodeGen/MachineFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class MachineFunction {
unsigned FunctionNumber;

/// Alignment - The alignment of the function.
llvm::Align Alignment;
Align Alignment;

/// ExposesReturnsTwice - True if the function calls setjmp or related
/// functions with attribute "returns twice", but doesn't have
Expand Down Expand Up @@ -509,13 +509,13 @@ class MachineFunction {
WinEHFuncInfo *getWinEHFuncInfo() { return WinEHInfo; }

/// getAlignment - Return the alignment of the function.
llvm::Align getAlignment() const { return Alignment; }
Align getAlignment() const { return Alignment; }

/// setAlignment - Set the alignment of the function.
void setAlignment(llvm::Align A) { Alignment = A; }
void setAlignment(Align A) { Alignment = A; }

/// ensureAlignment - Make sure the function is at least A bytes aligned.
void ensureAlignment(llvm::Align A) {
void ensureAlignment(Align A) {
if (Alignment < A)
Alignment = A;
}
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/CodeGen/TargetCallingConv.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace ISD {
return A ? A->value() : 0;
}
void setByValAlign(unsigned A) {
ByValAlign = encode(llvm::Align(A));
ByValAlign = encode(Align(A));
assert(getByValAlign() == A && "bitfield overflow");
}

Expand All @@ -135,7 +135,7 @@ namespace ISD {
return A ? A->value() : 0;
}
void setOrigAlign(unsigned A) {
OrigAlign = encode(llvm::Align(A));
OrigAlign = encode(Align(A));
assert(getOrigAlign() == A && "bitfield overflow");
}

Expand Down
30 changes: 15 additions & 15 deletions include/llvm/CodeGen/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -1596,18 +1596,18 @@ class TargetLoweringBase {
}

/// Return the minimum stack alignment of an argument.
llvm::Align getMinStackArgumentAlignment() const {
Align getMinStackArgumentAlignment() const {
return MinStackArgumentAlignment;
}

/// Return the minimum function alignment.
llvm::Align getMinFunctionAlignment() const { return MinFunctionAlignment; }
Align getMinFunctionAlignment() const { return MinFunctionAlignment; }

/// Return the preferred function alignment.
llvm::Align getPrefFunctionAlignment() const { return PrefFunctionAlignment; }
Align getPrefFunctionAlignment() const { return PrefFunctionAlignment; }

/// Return the preferred loop alignment.
virtual llvm::Align getPrefLoopAlignment(MachineLoop *ML = nullptr) const {
virtual Align getPrefLoopAlignment(MachineLoop *ML = nullptr) const {
return PrefLoopAlignment;
}

Expand Down Expand Up @@ -2120,24 +2120,24 @@ class TargetLoweringBase {
}

/// Set the target's minimum function alignment.
void setMinFunctionAlignment(llvm::Align Align) {
MinFunctionAlignment = Align;
void setMinFunctionAlignment(Align Alignment) {
MinFunctionAlignment = Alignment;
}

/// Set the target's preferred function alignment. This should be set if
/// there is a performance benefit to higher-than-minimum alignment
void setPrefFunctionAlignment(llvm::Align Align) {
PrefFunctionAlignment = Align;
void setPrefFunctionAlignment(Align Alignment) {
PrefFunctionAlignment = Alignment;
}

/// Set the target's preferred loop alignment. Default alignment is one, it
/// means the target does not care about loop alignment. The target may also
/// override getPrefLoopAlignment to provide per-loop values.
void setPrefLoopAlignment(llvm::Align Align) { PrefLoopAlignment = Align; }
void setPrefLoopAlignment(Align Alignment) { PrefLoopAlignment = Alignment; }

/// Set the minimum stack alignment of an argument.
void setMinStackArgumentAlignment(llvm::Align Align) {
MinStackArgumentAlignment = Align;
void setMinStackArgumentAlignment(Align Alignment) {
MinStackArgumentAlignment = Alignment;
}

/// Set the maximum atomic operation size supported by the
Expand Down Expand Up @@ -2699,18 +2699,18 @@ class TargetLoweringBase {
Sched::Preference SchedPreferenceInfo;

/// The minimum alignment that any argument on the stack needs to have.
llvm::Align MinStackArgumentAlignment;
Align MinStackArgumentAlignment;

/// The minimum function alignment (used when optimizing for size, and to
/// prevent explicitly provided alignment from leading to incorrect code).
llvm::Align MinFunctionAlignment;
Align MinFunctionAlignment;

/// The preferred function alignment (used when alignment unspecified and
/// optimizing for speed).
llvm::Align PrefFunctionAlignment;
Align PrefFunctionAlignment;

/// The preferred loop alignment (in log2 bot in bytes).
llvm::Align PrefLoopAlignment;
Align PrefLoopAlignment;

/// Size in bits of the maximum atomics size the backend supports.
/// Accesses larger than this will be expanded by AtomicExpandPass.
Expand Down
Loading

0 comments on commit 71864c0

Please sign in to comment.