Skip to content

Commit ae33010

Browse files
committed
rebase
Created using spr 1.3.5-bogner
2 parents 7f477b9 + 0937233 commit ae33010

Some content is hidden

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

41 files changed

+610
-549
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25572557
else if (Fixup.getKind() ==
25582558
MCFixupKind(AArch64::fixup_aarch64_pcrel_branch26))
25592559
RelType = ELF::R_AARCH64_JUMP26;
2560-
else if (FKI.Flags & MCFixupKindInfo::FKF_IsPCRel) {
2560+
else if (Fixup.isPCRel()) {
25612561
switch (FKI.TargetSize) {
25622562
default:
25632563
return std::nullopt;

clang/lib/Driver/ToolChains/HIPAMD.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,22 @@ HIPAMDToolChain::getDeviceLibs(const llvm::opt::ArgList &DriverArgs) const {
372372
// Maintain compatability with --hip-device-lib.
373373
auto BCLibArgs = DriverArgs.getAllArgValues(options::OPT_hip_device_lib_EQ);
374374
if (!BCLibArgs.empty()) {
375-
llvm::for_each(BCLibArgs, [&](StringRef BCName) {
375+
for (StringRef BCName : BCLibArgs) {
376376
StringRef FullName;
377+
bool Found = false;
377378
for (StringRef LibraryPath : LibraryPaths) {
378379
SmallString<128> Path(LibraryPath);
379380
llvm::sys::path::append(Path, BCName);
380381
FullName = Path;
381382
if (llvm::sys::fs::exists(FullName)) {
382383
BCLibs.emplace_back(FullName);
383-
return;
384+
Found = true;
385+
break;
384386
}
385387
}
386-
getDriver().Diag(diag::err_drv_no_such_file) << BCName;
387-
});
388+
if (!Found)
389+
getDriver().Diag(diag::err_drv_no_such_file) << BCName;
390+
}
388391
} else {
389392
if (!RocmInstallation->hasDeviceLibrary()) {
390393
getDriver().Diag(diag::err_drv_no_rocm_device_lib) << 0;

clang/lib/Driver/ToolChains/HIPSPV.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,22 @@ HIPSPVToolChain::getDeviceLibs(const llvm::opt::ArgList &DriverArgs) const {
226226
// Maintain compatability with --hip-device-lib.
227227
auto BCLibArgs = DriverArgs.getAllArgValues(options::OPT_hip_device_lib_EQ);
228228
if (!BCLibArgs.empty()) {
229-
llvm::for_each(BCLibArgs, [&](StringRef BCName) {
229+
bool Found = false;
230+
for (StringRef BCName : BCLibArgs) {
230231
StringRef FullName;
231232
for (std::string LibraryPath : LibraryPaths) {
232233
SmallString<128> Path(LibraryPath);
233234
llvm::sys::path::append(Path, BCName);
234235
FullName = Path;
235236
if (llvm::sys::fs::exists(FullName)) {
236237
BCLibs.emplace_back(FullName.str());
237-
return;
238+
Found = true;
239+
break;
238240
}
239241
}
240-
getDriver().Diag(diag::err_drv_no_such_file) << BCName;
241-
});
242+
if (!Found)
243+
getDriver().Diag(diag::err_drv_no_such_file) << BCName;
244+
}
242245
} else {
243246
// Search device library named as 'hipspv-<triple>.bc'.
244247
auto TT = getTriple().normalize();

clang/lib/Index/IndexBody.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
6969
while (isa<CastExpr>(*It) || isa<ParenExpr>(*It)) {
7070
if (auto ICE = dyn_cast<ImplicitCastExpr>(*It)) {
7171
if (ICE->getCastKind() == CK_LValueToRValue)
72-
Roles |= (unsigned)(unsigned)SymbolRole::Read;
72+
Roles |= (unsigned)SymbolRole::Read;
7373
}
7474
if (It == StmtStack.begin())
7575
break;

llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ namespace bfi_detail {
7272

7373
struct IrreducibleGraph;
7474

75-
// This is part of a workaround for a GCC 4.7 crash on lambdas.
76-
template <class BT> struct BlockEdgesAdder;
77-
7875
/// Mass of a block.
7976
///
8077
/// This class implements a sort of fixed-point fraction always between 0.0 and
@@ -843,9 +840,6 @@ void IrreducibleGraph::addEdges(const BlockNode &Node,
843840
/// (Running this until fixed point would "solve" the geometric
844841
/// series by simulation.)
845842
template <class BT> class BlockFrequencyInfoImpl : BlockFrequencyInfoImplBase {
846-
// This is part of a workaround for a GCC 4.7 crash on lambdas.
847-
friend struct bfi_detail::BlockEdgesAdder<BT>;
848-
849843
using BlockT = typename bfi_detail::TypeMap<BT>::BlockT;
850844
using BlockKeyT = typename bfi_detail::TypeMap<BT>::BlockKeyT;
851845
using FunctionT = typename bfi_detail::TypeMap<BT>::FunctionT;

llvm/include/llvm/IR/LegacyPassManagers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ class LLVM_ABI PMDataManager {
333333
/// Initialize available analysis information.
334334
void initializeAnalysisInfo() {
335335
AvailableAnalysis.clear();
336-
for (auto &IA : InheritedAnalysis)
337-
IA = nullptr;
336+
llvm::fill(InheritedAnalysis, nullptr);
338337
}
339338

340339
// Return true if P preserves high level analysis used by other

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ inline bool llvm_fenv_testexcept() {
19631963
return false;
19641964
}
19651965

1966-
static const APFloat FTZPreserveSign(const APFloat &V) {
1966+
static APFloat FTZPreserveSign(const APFloat &V) {
19671967
if (V.isDenormal())
19681968
return APFloat::getZero(V.getSemantics(), V.isNegative());
19691969
return V;

llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ void CompileUnit::maybeResetToLoadedStage() {
101101
OutUnitDIE = nullptr;
102102
DebugAddrIndexMap.clear();
103103

104-
for (uint64_t &Offset : OutDieOffsetArray)
105-
Offset = 0;
106-
for (TypeEntry *&Name : TypeEntries)
107-
Name = nullptr;
104+
llvm::fill(OutDieOffsetArray, 0);
105+
llvm::fill(TypeEntries, nullptr);
108106
eraseSections();
109107

110108
setStage(Stage::CreatedNotLoaded);

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ AMDGPUAsmBackend::getFixupKind(StringRef Name) const {
175175

176176
MCFixupKindInfo AMDGPUAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
177177
const static MCFixupKindInfo Infos[AMDGPU::NumTargetFixupKinds] = {
178-
// name offset bits flags
179-
{ "fixup_si_sopp_br", 0, 16, MCFixupKindInfo::FKF_IsPCRel },
178+
// name offset bits flags
179+
{"fixup_si_sopp_br", 0, 16, 0},
180180
};
181181

182182
if (mc::isRelocation(Kind))

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ MCCodeEmitter *llvm::createAMDGPUMCCodeEmitter(const MCInstrInfo &MCII,
103103
return new AMDGPUMCCodeEmitter(MCII, *Ctx.getRegisterInfo());
104104
}
105105

106+
static void addFixup(SmallVectorImpl<MCFixup> &Fixups, uint32_t Offset,
107+
const MCExpr *Value, uint16_t Kind, bool PCRel = false) {
108+
Fixups.push_back(MCFixup::create(Offset, Value, Kind, PCRel));
109+
}
110+
106111
// Returns the encoding value to use if the given integer is an integer inline
107112
// immediate value, or 0 if it is not.
108113
template <typename IntTy>
@@ -445,8 +450,7 @@ void AMDGPUMCCodeEmitter::getSOPPBrEncoding(const MCInst &MI, unsigned OpNo,
445450

446451
if (MO.isExpr()) {
447452
const MCExpr *Expr = MO.getExpr();
448-
MCFixupKind Kind = (MCFixupKind)AMDGPU::fixup_si_sopp_br;
449-
Fixups.push_back(MCFixup::create(0, Expr, Kind));
453+
addFixup(Fixups, 0, Expr, AMDGPU::fixup_si_sopp_br, true);
450454
Op = APInt::getZero(96);
451455
} else {
452456
getMachineOpValue(MI, MO, Op, Fixups, STI);
@@ -661,8 +665,7 @@ void AMDGPUMCCodeEmitter::getMachineOpValueCommon(
661665
const MCInstrDesc &Desc = MCII.get(MI.getOpcode());
662666
uint32_t Offset = Desc.getSize();
663667
assert(Offset == 4 || Offset == 8);
664-
665-
Fixups.push_back(MCFixup::create(Offset, MO.getExpr(), Kind));
668+
addFixup(Fixups, Offset, MO.getExpr(), Kind, Kind == FK_PCRel_4);
666669
}
667670

668671
const MCInstrDesc &Desc = MCII.get(MI.getOpcode());

0 commit comments

Comments
 (0)