4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86TargetTransformInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ class X86TTIImpl : public BasicTTIImplBase<X86TTIImpl> {
bool canMacroFuseCmp();
bool isLegalMaskedLoad(Type *DataType);
bool isLegalMaskedStore(Type *DataType);
bool isLegalNTLoad(Type *DataType, llvm::Align Alignment);
bool isLegalNTStore(Type *DataType, llvm::Align Alignment);
bool isLegalNTLoad(Type *DataType, Align Alignment);
bool isLegalNTStore(Type *DataType, Align Alignment);
bool isLegalMaskedGather(Type *DataType);
bool isLegalMaskedScatter(Type *DataType);
bool isLegalMaskedExpandLoad(Type *DataType);
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/XCore/XCoreAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {

MCSymbol *GVSym = getSymbol(GV);
const Constant *C = GV->getInitializer();
const llvm::Align Align(DL.getPrefTypeAlignment(C->getType()));
const Align Alignment(DL.getPrefTypeAlignment(C->getType()));

// Mark the start of the global
getTargetStreamer().emitCCTopData(GVSym->getName());
Expand Down Expand Up @@ -143,7 +143,7 @@ void XCoreAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
llvm_unreachable("Unknown linkage type!");
}

EmitAlignment(std::max(Align, llvm::Align(4)), GV);
EmitAlignment(std::max(Alignment, Align(4)), GV);

if (GV->isThreadLocal()) {
report_fatal_error("TLS is not supported by this target!");
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/XCore/XCoreISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ XCoreTargetLowering::XCoreTargetLowering(const TargetMachine &TM,
setTargetDAGCombine(ISD::INTRINSIC_VOID);
setTargetDAGCombine(ISD::INTRINSIC_W_CHAIN);

setMinFunctionAlignment(llvm::Align(2));
setPrefFunctionAlignment(llvm::Align(4));
setMinFunctionAlignment(Align(2));
setPrefFunctionAlignment(Align(4));
}

bool XCoreTargetLowering::isZExtFree(SDValue Val, EVT VT2) const {
Expand Down
24 changes: 12 additions & 12 deletions llvm/lib/Transforms/Utils/Local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,10 +1132,10 @@ bool llvm::EliminateDuplicatePHINodes(BasicBlock *BB) {
/// often possible though. If alignment is important, a more reliable approach
/// is to simply align all global variables and allocation instructions to
/// their preferred alignment from the beginning.
static unsigned enforceKnownAlignment(Value *V, unsigned Align,
static unsigned enforceKnownAlignment(Value *V, unsigned Alignment,
unsigned PrefAlign,
const DataLayout &DL) {
assert(PrefAlign > Align);
assert(PrefAlign > Alignment);

V = V->stripPointerCasts();

Expand All @@ -1146,36 +1146,36 @@ static unsigned enforceKnownAlignment(Value *V, unsigned Align,
// stripPointerCasts recurses through infinite layers of bitcasts,
// while computeKnownBits is not allowed to traverse more than 6
// levels.
Align = std::max(AI->getAlignment(), Align);
if (PrefAlign <= Align)
return Align;
Alignment = std::max(AI->getAlignment(), Alignment);
if (PrefAlign <= Alignment)
return Alignment;

// If the preferred alignment is greater than the natural stack alignment
// then don't round up. This avoids dynamic stack realignment.
if (DL.exceedsNaturalStackAlignment(llvm::Align(PrefAlign)))
return Align;
if (DL.exceedsNaturalStackAlignment(Align(PrefAlign)))
return Alignment;
AI->setAlignment(PrefAlign);
return PrefAlign;
}

if (auto *GO = dyn_cast<GlobalObject>(V)) {
// TODO: as above, this shouldn't be necessary.
Align = std::max(GO->getAlignment(), Align);
if (PrefAlign <= Align)
return Align;
Alignment = std::max(GO->getAlignment(), Alignment);
if (PrefAlign <= Alignment)
return Alignment;

// If there is a large requested alignment and we can, bump up the alignment
// of the global. If the memory we set aside for the global may not be the
// memory used by the final program then it is impossible for us to reliably
// enforce the preferred alignment.
if (!GO->canIncreaseAlignment())
return Align;
return Alignment;

GO->setAlignment(PrefAlign);
return PrefAlign;
}

return Align;
return Alignment;
}

unsigned llvm::getOrEnforceKnownAlignment(Value *V, unsigned PrefAlign,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
assert(VecTy && "did not find vectorized version of stored type");
unsigned Alignment = getLoadStoreAlignment(ST);
assert(Alignment && "Alignment should be set");
if (!TTI->isLegalNTStore(VecTy, llvm::Align(Alignment))) {
if (!TTI->isLegalNTStore(VecTy, Align(Alignment))) {
reportVectorizationFailure(
"nontemporal store instruction cannot be vectorized",
"nontemporal store instruction cannot be vectorized",
Expand All @@ -759,7 +759,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
assert(VecTy && "did not find vectorized version of load type");
unsigned Alignment = getLoadStoreAlignment(LD);
assert(Alignment && "Alignment should be set");
if (!TTI->isLegalNTLoad(VecTy, llvm::Align(Alignment))) {
if (!TTI->isLegalNTLoad(VecTy, Align(Alignment))) {
reportVectorizationFailure(
"nontemporal load instruction cannot be vectorized",
"nontemporal load instruction cannot be vectorized",
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/dsymutil/DwarfStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void DwarfStreamer::emitAppleTypes(
/// Emit the swift_ast section stored in \p Buffers.
void DwarfStreamer::emitSwiftAST(StringRef Buffer) {
MCSection *SwiftASTSection = MOFI->getDwarfSwiftASTSection();
SwiftASTSection->setAlignment(llvm::Align(32));
SwiftASTSection->setAlignment(Align(32));
MS->SwitchSection(SwiftASTSection);
MS->EmitBytes(Buffer);
}
Expand Down Expand Up @@ -339,7 +339,7 @@ void DwarfStreamer::emitUnitRangesEntries(CompileUnit &Unit,
sizeof(int8_t); // Segment Size (in bytes)

unsigned TupleSize = AddressSize * 2;
unsigned Padding = offsetToAlignment(HeaderSize, llvm::Align(TupleSize));
unsigned Padding = offsetToAlignment(HeaderSize, Align(TupleSize));

Asm->EmitLabelDifference(EndLabel, BeginLabel, 4); // Arange length
Asm->OutStreamer->EmitLabel(BeginLabel);
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/TestingSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int convertForTestingMain(int argc, const char *argv[]) {
encodeULEB128(ProfileNamesAddress, OS);
OS << ProfileNamesData;
// Coverage mapping data is expected to have an alignment of 8.
for (unsigned Pad = offsetToAlignment(OS.tell(), llvm::Align(8)); Pad; --Pad)
for (unsigned Pad = offsetToAlignment(OS.tell(), Align(8)); Pad; --Pad)
OS.write(uint8_t(0));
OS << CoverageMappingData;

Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ uint64_t MachOLayoutBuilder::layoutSegments() {
Sec.Offset = 0;
} else {
uint64_t PaddingSize =
offsetToAlignment(SegFileSize, llvm::Align(1ull << Sec.Align));
offsetToAlignment(SegFileSize, Align(1ull << Sec.Align));
Sec.Offset = SegOffset + SegFileSize + PaddingSize;
Sec.Size = Sec.Content.size();
SegFileSize += PaddingSize + Sec.Size;
Expand Down