Skip to content

Commit 18f805a

Browse files
committed
[Alignment][NFC] Remove unneeded llvm:: scoping on Align types
llvm-svn: 373081
1 parent 7e317ca commit 18f805a

File tree

94 files changed

+434
-453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+434
-453
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,9 @@ class TargetTransformInfo {
580580
bool isLegalMaskedLoad(Type *DataType) const;
581581

582582
/// Return true if the target supports nontemporal store.
583-
bool isLegalNTStore(Type *DataType, llvm::Align Alignment) const;
583+
bool isLegalNTStore(Type *DataType, Align Alignment) const;
584584
/// Return true if the target supports nontemporal load.
585-
bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) const;
585+
bool isLegalNTLoad(Type *DataType, Align Alignment) const;
586586

587587
/// Return true if the target supports masked scatter.
588588
bool isLegalMaskedScatter(Type *DataType) const;
@@ -1196,8 +1196,8 @@ class TargetTransformInfo::Concept {
11961196
virtual bool shouldFavorBackedgeIndex(const Loop *L) const = 0;
11971197
virtual bool isLegalMaskedStore(Type *DataType) = 0;
11981198
virtual bool isLegalMaskedLoad(Type *DataType) = 0;
1199-
virtual bool isLegalNTStore(Type *DataType, llvm::Align Alignment) = 0;
1200-
virtual bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) = 0;
1199+
virtual bool isLegalNTStore(Type *DataType, Align Alignment) = 0;
1200+
virtual bool isLegalNTLoad(Type *DataType, Align Alignment) = 0;
12011201
virtual bool isLegalMaskedScatter(Type *DataType) = 0;
12021202
virtual bool isLegalMaskedGather(Type *DataType) = 0;
12031203
virtual bool isLegalMaskedCompressStore(Type *DataType) = 0;
@@ -1471,10 +1471,10 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
14711471
bool isLegalMaskedLoad(Type *DataType) override {
14721472
return Impl.isLegalMaskedLoad(DataType);
14731473
}
1474-
bool isLegalNTStore(Type *DataType, llvm::Align Alignment) override {
1474+
bool isLegalNTStore(Type *DataType, Align Alignment) override {
14751475
return Impl.isLegalNTStore(DataType, Alignment);
14761476
}
1477-
bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) override {
1477+
bool isLegalNTLoad(Type *DataType, Align Alignment) override {
14781478
return Impl.isLegalNTLoad(DataType, Alignment);
14791479
}
14801480
bool isLegalMaskedScatter(Type *DataType) override {

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,14 @@ class TargetTransformInfoImplBase {
247247

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

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

257-
bool isLegalNTLoad(Type *DataType, llvm::Align Alignment) {
257+
bool isLegalNTLoad(Type *DataType, Align Alignment) {
258258
// By default, assume nontemporal memory loads are available for loads that
259259
// are aligned and have a size that is a power of 2.
260260
unsigned DataSize = DL.getTypeStoreSize(DataType);

llvm/include/llvm/CodeGen/AsmPrinter.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ class AsmPrinter : public MachineFunctionPass {
350350
/// global value is specified, and if that global has an explicit alignment
351351
/// requested, it will override the alignment request if required for
352352
/// correctness.
353-
void EmitAlignment(llvm::Align Align, const GlobalObject *GV = nullptr) const;
353+
void EmitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;
354354

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

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

649649
private:
650650
/// Private state for PrintSpecial()

llvm/include/llvm/CodeGen/CallingConvLower.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -424,18 +424,18 @@ class CCState {
424424
/// AllocateStack - Allocate a chunk of stack space with the specified size
425425
/// and alignment.
426426
unsigned AllocateStack(unsigned Size, unsigned Alignment) {
427-
const llvm::Align Align(Alignment);
428-
StackOffset = alignTo(StackOffset, Align);
427+
const Align CheckedAlignment(Alignment);
428+
StackOffset = alignTo(StackOffset, CheckedAlignment);
429429
unsigned Result = StackOffset;
430430
StackOffset += Size;
431-
MaxStackArgAlign = std::max(Align, MaxStackArgAlign);
432-
ensureMaxAlignment(Align);
431+
MaxStackArgAlign = std::max(CheckedAlignment, MaxStackArgAlign);
432+
ensureMaxAlignment(CheckedAlignment);
433433
return Result;
434434
}
435435

436-
void ensureMaxAlignment(llvm::Align Align) {
436+
void ensureMaxAlignment(Align Alignment) {
437437
if (!AnalyzingMustTailForwardedRegs)
438-
MF.getFrameInfo().ensureMaxAlignment(Align.value());
438+
MF.getFrameInfo().ensureMaxAlignment(Alignment.value());
439439
}
440440

441441
/// Version of AllocateStack with extra register to be shadowed.

llvm/include/llvm/CodeGen/MachineBasicBlock.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class MachineBasicBlock
105105

106106
/// Alignment of the basic block. One if the basic block does not need to be
107107
/// aligned.
108-
llvm::Align Alignment;
108+
Align Alignment;
109109

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

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

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

381381
/// Returns true if the block is a landing pad. That is this basic block is
382382
/// entered via an exception handler.

llvm/include/llvm/CodeGen/MachineFrameInfo.h

+11-10
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class MachineFrameInfo {
181181

182182
uint8_t SSPLayout;
183183

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

420420
/// Required alignment of the local object blob,
421421
/// which is the strictest alignment of any object in it.
422-
void setLocalFrameMaxAlign(Align Align) { LocalFrameMaxAlign = Align; }
422+
void setLocalFrameMaxAlign(Align Alignment) {
423+
LocalFrameMaxAlign = Alignment;
424+
}
423425

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

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

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

746748
/// Create a new statically sized stack object that represents a spill slot,
747749
/// returning a nonnegative identifier to represent it.
748-
int CreateSpillStackObject(uint64_t Size, llvm::Align Alignment);
749-
/// FIXME: Remove this function when transition to llvm::Align is over.
750+
int CreateSpillStackObject(uint64_t Size, Align Alignment);
751+
/// FIXME: Remove this function when transition to Align is over.
750752
inline int CreateSpillStackObject(uint64_t Size, unsigned Alignment) {
751753
return CreateSpillStackObject(Size, assumeAligned(Alignment));
752754
}
@@ -760,9 +762,8 @@ class MachineFrameInfo {
760762
/// Notify the MachineFrameInfo object that a variable sized object has been
761763
/// created. This must be created whenever a variable sized object is
762764
/// created, whether or not the index returned is actually used.
763-
int CreateVariableSizedObject(llvm::Align Alignment,
764-
const AllocaInst *Alloca);
765-
/// FIXME: Remove this function when transition to llvm::Align is over.
765+
int CreateVariableSizedObject(Align Alignment, const AllocaInst *Alloca);
766+
/// FIXME: Remove this function when transition to Align is over.
766767
int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca) {
767768
return CreateVariableSizedObject(assumeAligned(Alignment), Alloca);
768769
}

llvm/include/llvm/CodeGen/MachineFunction.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class MachineFunction {
277277
unsigned FunctionNumber;
278278

279279
/// Alignment - The alignment of the function.
280-
llvm::Align Alignment;
280+
Align Alignment;
281281

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

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

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

517517
/// ensureAlignment - Make sure the function is at least A bytes aligned.
518-
void ensureAlignment(llvm::Align A) {
518+
void ensureAlignment(Align A) {
519519
if (Alignment < A)
520520
Alignment = A;
521521
}

llvm/include/llvm/CodeGen/TargetCallingConv.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ namespace ISD {
126126
return A ? A->value() : 0;
127127
}
128128
void setByValAlign(unsigned A) {
129-
ByValAlign = encode(llvm::Align(A));
129+
ByValAlign = encode(Align(A));
130130
assert(getByValAlign() == A && "bitfield overflow");
131131
}
132132

@@ -135,7 +135,7 @@ namespace ISD {
135135
return A ? A->value() : 0;
136136
}
137137
void setOrigAlign(unsigned A) {
138-
OrigAlign = encode(llvm::Align(A));
138+
OrigAlign = encode(Align(A));
139139
assert(getOrigAlign() == A && "bitfield overflow");
140140
}
141141

llvm/include/llvm/CodeGen/TargetLowering.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -1596,18 +1596,18 @@ class TargetLoweringBase {
15961596
}
15971597

15981598
/// Return the minimum stack alignment of an argument.
1599-
llvm::Align getMinStackArgumentAlignment() const {
1599+
Align getMinStackArgumentAlignment() const {
16001600
return MinStackArgumentAlignment;
16011601
}
16021602

16031603
/// Return the minimum function alignment.
1604-
llvm::Align getMinFunctionAlignment() const { return MinFunctionAlignment; }
1604+
Align getMinFunctionAlignment() const { return MinFunctionAlignment; }
16051605

16061606
/// Return the preferred function alignment.
1607-
llvm::Align getPrefFunctionAlignment() const { return PrefFunctionAlignment; }
1607+
Align getPrefFunctionAlignment() const { return PrefFunctionAlignment; }
16081608

16091609
/// Return the preferred loop alignment.
1610-
virtual llvm::Align getPrefLoopAlignment(MachineLoop *ML = nullptr) const {
1610+
virtual Align getPrefLoopAlignment(MachineLoop *ML = nullptr) const {
16111611
return PrefLoopAlignment;
16121612
}
16131613

@@ -2120,24 +2120,24 @@ class TargetLoweringBase {
21202120
}
21212121

21222122
/// Set the target's minimum function alignment.
2123-
void setMinFunctionAlignment(llvm::Align Align) {
2124-
MinFunctionAlignment = Align;
2123+
void setMinFunctionAlignment(Align Alignment) {
2124+
MinFunctionAlignment = Alignment;
21252125
}
21262126

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

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

21382138
/// Set the minimum stack alignment of an argument.
2139-
void setMinStackArgumentAlignment(llvm::Align Align) {
2140-
MinStackArgumentAlignment = Align;
2139+
void setMinStackArgumentAlignment(Align Alignment) {
2140+
MinStackArgumentAlignment = Alignment;
21412141
}
21422142

21432143
/// Set the maximum atomic operation size supported by the
@@ -2699,18 +2699,18 @@ class TargetLoweringBase {
26992699
Sched::Preference SchedPreferenceInfo;
27002700

27012701
/// The minimum alignment that any argument on the stack needs to have.
2702-
llvm::Align MinStackArgumentAlignment;
2702+
Align MinStackArgumentAlignment;
27032703

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

27082708
/// The preferred function alignment (used when alignment unspecified and
27092709
/// optimizing for speed).
2710-
llvm::Align PrefFunctionAlignment;
2710+
Align PrefFunctionAlignment;
27112711

27122712
/// The preferred loop alignment (in log2 bot in bytes).
2713-
llvm::Align PrefLoopAlignment;
2713+
Align PrefLoopAlignment;
27142714

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

0 commit comments

Comments
 (0)