Skip to content

Commit fdf184d

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:a9136f0ad94b into amd-gfx:029a46b97375
Local branch amd-gfx 029a46b Merged main:4f56d47d050e into amd-gfx:7cd9c5eed736 Remote branch main a9136f0 [Utils] Use std::remove_pointer_t (NFC)
2 parents 029a46b + a9136f0 commit fdf184d

File tree

19 files changed

+37
-33
lines changed

19 files changed

+37
-33
lines changed

clang-tools-extra/clangd/Hover.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,8 @@ void addLayoutInfo(const NamedDecl &ND, HoverInfo &HI) {
10011001
if (auto *RD = llvm::dyn_cast<RecordDecl>(&ND)) {
10021002
if (auto Size = Ctx.getTypeSizeInCharsIfKnown(RD->getTypeForDecl()))
10031003
HI.Size = Size->getQuantity() * 8;
1004+
if (!RD->isDependentType() && RD->isCompleteDefinition())
1005+
HI.Align = Ctx.getTypeAlign(RD->getTypeForDecl());
10041006
return;
10051007
}
10061008

@@ -1009,6 +1011,7 @@ void addLayoutInfo(const NamedDecl &ND, HoverInfo &HI) {
10091011
if (Record)
10101012
Record = Record->getDefinition();
10111013
if (Record && !Record->isInvalidDecl() && !Record->isDependentType()) {
1014+
HI.Align = Ctx.getTypeAlign(FD->getType());
10121015
const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(Record);
10131016
HI.Offset = Layout.getFieldOffset(FD->getFieldIndex());
10141017
if (FD->isBitField())
@@ -1487,6 +1490,8 @@ markup::Document HoverInfo::present() const {
14871490
P.appendText(
14881491
llvm::formatv(" (+{0} padding)", formatSize(*Padding)).str());
14891492
}
1493+
if (Align)
1494+
P.appendText(", alignment " + formatSize(*Align));
14901495
}
14911496

14921497
if (CalleeArgInfo) {

clang-tools-extra/clangd/Hover.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ struct HoverInfo {
9797
std::optional<uint64_t> Offset;
9898
/// Contains the padding following a field within the enclosing class.
9999
std::optional<uint64_t> Padding;
100+
/// Contains the alignment of fields and types where it's interesting.
101+
std::optional<uint64_t> Align;
100102
// Set when symbol is inside function call. Contains information extracted
101103
// from the callee definition about the argument this is passed as.
102104
std::optional<Param> CalleeArgInfo;

clang-tools-extra/clangd/unittests/HoverTests.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ TEST(Hover, Structured) {
9292
HI.Offset = 0;
9393
HI.Size = 8;
9494
HI.Padding = 56;
95+
HI.Align = 8;
9596
HI.AccessSpecifier = "private";
9697
}},
9798
// Union field
@@ -110,6 +111,7 @@ TEST(Hover, Structured) {
110111
HI.Type = "char";
111112
HI.Size = 8;
112113
HI.Padding = 120;
114+
HI.Align = 8;
113115
HI.AccessSpecifier = "public";
114116
}},
115117
// Bitfield
@@ -128,6 +130,7 @@ TEST(Hover, Structured) {
128130
HI.Type = "int";
129131
HI.Offset = 0;
130132
HI.Size = 1;
133+
HI.Align = 32;
131134
HI.AccessSpecifier = "public";
132135
}},
133136
// Local to class method.
@@ -192,6 +195,7 @@ TEST(Hover, Structured) {
192195
HI.Type = "char";
193196
HI.Offset = 0;
194197
HI.Size = 8;
198+
HI.Align = 8;
195199
HI.AccessSpecifier = "public";
196200
}},
197201
// Struct definition shows size.
@@ -204,6 +208,7 @@ TEST(Hover, Structured) {
204208
HI.Kind = index::SymbolKind::Struct;
205209
HI.Definition = "struct X {}";
206210
HI.Size = 8;
211+
HI.Align = 8;
207212
}},
208213
// Variable with template type
209214
{R"cpp(
@@ -1375,6 +1380,7 @@ class Foo final {})cpp";
13751380
HI.Offset = 8;
13761381
HI.Size = 1;
13771382
HI.Padding = 23;
1383+
HI.Align = 8;
13781384
HI.AccessSpecifier = "public";
13791385
}}};
13801386
for (const auto &Case : Cases) {
@@ -1411,6 +1417,7 @@ class Foo final {})cpp";
14111417
EXPECT_EQ(H->Value, Expected.Value);
14121418
EXPECT_EQ(H->Size, Expected.Size);
14131419
EXPECT_EQ(H->Offset, Expected.Offset);
1420+
EXPECT_EQ(H->Align, Expected.Align);
14141421
EXPECT_EQ(H->AccessSpecifier, Expected.AccessSpecifier);
14151422
EXPECT_EQ(H->CalleeArgInfo, Expected.CalleeArgInfo);
14161423
EXPECT_EQ(H->CallPassType, Expected.CallPassType);
@@ -3448,13 +3455,14 @@ template <typename T, typename C = bool> class Foo {})",
34483455
HI.Size = 32;
34493456
HI.Offset = 96;
34503457
HI.Padding = 32;
3458+
HI.Align = 32;
34513459
},
34523460
R"(field foo
34533461
34543462
Type: type (aka can_type)
34553463
Value = value
34563464
Offset: 12 bytes
3457-
Size: 4 bytes (+4 bytes padding)
3465+
Size: 4 bytes (+4 bytes padding), alignment 4 bytes
34583466
34593467
// In test::Bar
34603468
def)",
@@ -3470,13 +3478,14 @@ def)",
34703478
HI.Size = 25;
34713479
HI.Offset = 35;
34723480
HI.Padding = 4;
3481+
HI.Align = 64;
34733482
},
34743483
R"(field foo
34753484
34763485
Type: type (aka can_type)
34773486
Value = value
34783487
Offset: 4 bytes and 3 bits
3479-
Size: 25 bits (+4 bits padding)
3488+
Size: 25 bits (+4 bits padding), alignment 8 bytes
34803489
34813490
// In test::Bar
34823491
def)",

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 478283
19+
#define LLVM_MAIN_REVISION 478289
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/Transforms/Utils/SampleProfileInference.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void applyFlowInference(FlowFunction &Func);
119119
template <typename FT> class SampleProfileInference {
120120
public:
121121
using NodeRef = typename GraphTraits<FT *>::NodeRef;
122-
using BasicBlockT = typename std::remove_pointer<NodeRef>::type;
122+
using BasicBlockT = std::remove_pointer_t<NodeRef>;
123123
using FunctionT = FT;
124124
using Edge = std::pair<const BasicBlockT *, const BasicBlockT *>;
125125
using BlockWeightMap = DenseMap<const BasicBlockT *, uint64_t>;

llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ template <typename FT> class SampleProfileLoaderBaseImpl {
152152
void dump() { Reader->dump(); }
153153

154154
using NodeRef = typename GraphTraits<FT *>::NodeRef;
155-
using BT = typename std::remove_pointer<NodeRef>::type;
155+
using BT = std::remove_pointer_t<NodeRef>;
156156
using InstructionT = typename afdo_detail::IRTraits<BT>::InstructionT;
157157
using BasicBlockT = typename afdo_detail::IRTraits<BT>::BasicBlockT;
158158
using BlockFrequencyInfoT =

llvm/lib/Analysis/VectorUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "llvm/Analysis/VectorUtils.h"
1414
#include "llvm/ADT/EquivalenceClasses.h"
15-
#include "llvm/ADT/SmallString.h"
1615
#include "llvm/Analysis/DemandedBits.h"
1716
#include "llvm/Analysis/LoopInfo.h"
1817
#include "llvm/Analysis/LoopIterator.h"

llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,10 @@ Error LVCompare::execute(LVReader *ReferenceReader, LVReader *TargetReader) {
206206
updateExpected(Reference);
207207
Reference->setIsInCompare();
208208
LVElement *CurrentTarget = nullptr;
209-
if (std::any_of(Targets.begin(), Targets.end(),
210-
[&](auto Target) -> bool {
211-
CurrentTarget = Target;
212-
return Reference->equals(Target);
213-
})) {
209+
if (llvm::any_of(Targets, [&](auto Target) -> bool {
210+
CurrentTarget = Target;
211+
return Reference->equals(Target);
212+
})) {
214213
if (Pass == LVComparePass::Missing && Reference->getIsScope()) {
215214
// If the elements being compared are scopes and are a match,
216215
// they are recorded, to be used when creating the augmented

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "llvm/ADT/ArrayRef.h"
1616
#include "llvm/ADT/DenseMap.h"
1717
#include "llvm/ADT/SmallBitVector.h"
18-
#include "llvm/ADT/SmallString.h"
1918
#include "llvm/ADT/SmallVector.h"
2019
#include "llvm/ADT/StringExtras.h"
2120
#include "llvm/ADT/StringRef.h"

llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,10 @@ class MFMASmallGemmSingleWaveOpt final : public IGLPStrategy {
965965

966966
// Does the VALU have a DS_WRITE successor that is the same as other
967967
// VALU already in the group. The V_PERMs will all share 1 DS_W succ
968-
return std::any_of(Cache->begin(), Cache->end(), [&SU](SUnit *Elt) {
969-
return std::any_of(SU->Succs.begin(), SU->Succs.end(),
970-
[&Elt](const SDep &ThisSucc) {
971-
return ThisSucc.getSUnit() == Elt;
972-
});
968+
return llvm::any_of(*Cache, [&SU](SUnit *Elt) {
969+
return llvm::any_of(SU->Succs, [&Elt](const SDep &ThisSucc) {
970+
return ThisSucc.getSUnit() == Elt;
971+
});
973972
});
974973
}
975974

@@ -1088,10 +1087,9 @@ class MFMASmallGemmSingleWaveOpt final : public IGLPStrategy {
10881087
auto DAG = SyncPipe[0].DAG;
10891088
// Does the previous DS_WRITE share a V_PERM predecessor with this
10901089
// VMEM_READ
1091-
return (
1092-
std::any_of(Cache->begin(), Cache->end(), [&SU, &DAG](SUnit *Elt) {
1093-
return DAG->IsReachable(const_cast<SUnit *>(SU), Elt);
1094-
}));
1090+
return llvm::any_of(*Cache, [&SU, &DAG](SUnit *Elt) {
1091+
return DAG->IsReachable(const_cast<SUnit *>(SU), Elt);
1092+
});
10951093
}
10961094
SharesPredWithPrevNthGroup(unsigned Distance, const SIInstrInfo *TII,
10971095
unsigned SGID, bool NeedsCache = false)

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152
#include "llvm/ADT/DenseMap.h"
153153
#include "llvm/ADT/DepthFirstIterator.h"
154154
#include "llvm/ADT/SetVector.h"
155-
#include "llvm/ADT/SmallString.h"
156155
#include "llvm/ADT/SmallVector.h"
157156
#include "llvm/ADT/StringExtras.h"
158157
#include "llvm/ADT/StringRef.h"

llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "DwarfGenerator.h"
1010
#include "DwarfUtils.h"
1111
#include "llvm/ADT/ArrayRef.h"
12-
#include "llvm/ADT/SmallString.h"
1312
#include "llvm/ADT/StringExtras.h"
1413
#include "llvm/ADT/StringRef.h"
1514
#include "llvm/BinaryFormat/Dwarf.h"

llvm/unittests/DebugInfo/Symbolizer/MarkupTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include "llvm/DebugInfo/Symbolize/Markup.h"
1111

12-
#include "llvm/ADT/SmallString.h"
1312
#include "llvm/ADT/Twine.h"
1413
#include "llvm/Support/FormatVariadic.h"
1514

llvm/unittests/ObjCopy/ObjCopyTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/ObjCopy/ObjCopy.h"
10-
#include "llvm/ADT/SmallString.h"
1110
#include "llvm/ObjCopy/ConfigManager.h"
1211
#include "llvm/Object/ObjectFile.h"
1312
#include "llvm/ObjectYAML/yaml2obj.h"

llvm/unittests/Support/CompressionTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "llvm/Support/Compression.h"
14-
#include "llvm/ADT/SmallString.h"
1514
#include "llvm/ADT/StringExtras.h"
1615
#include "llvm/ADT/StringRef.h"
1716
#include "llvm/Config/config.h"

llvm/unittests/Support/NativeFormatTests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "llvm/ADT/SmallString.h"
109
#include "llvm/Support/NativeFormatting.h"
1110
#include "llvm/Support/raw_ostream.h"
1211
#include "gtest/gtest.h"

llvm/unittests/Support/SHA256.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#include "llvm/Support/SHA256.h"
1515
#include "llvm/ADT/ArrayRef.h"
16-
#include "llvm/ADT/SmallString.h"
1716
#include "gtest/gtest.h"
1817

1918
using namespace llvm;

mlir/examples/minimal-opt/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Below are some example measurements taken at the time of the LLVM 17 release,
1414
using clang-14 on a X86 Ubuntu and [bloaty](https://github.com/google/bloaty).
1515

1616
| | Base | Os | Oz | Os LTO | Oz LTO |
17-
| :------------------------------: | ------ | ------ | ------ | ------ | ------ |
18-
| `mlir-cat` | 1018kB | 836KB | 879KB | 697KB | 649KB |
19-
| `mlir-minimal-opt` | 1.54MB | 1.25MB | 1.29MB | 1.10MB | 1.00MB |
20-
| `mlir-minimal-opt-canonicalizer` | 2.24MB | 1.81MB | 1.86MB | 1.62MB | 1.48MB |
17+
| :-----------------------------: | ------ | ------ | ------ | ------ | ------ |
18+
| `mlir-cat` | 1018kB | 836KB | 879KB | 697KB | 649KB |
19+
| `mlir-minimal-opt` | 1.54MB | 1.25MB | 1.29MB | 1.10MB | 1.00MB |
20+
| `mlir-minimal-opt-canonicalize` | 2.24MB | 1.81MB | 1.86MB | 1.62MB | 1.48MB |
2121

2222
Base configuration:
2323

mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static inline void aliasIntoMemref(DataSizeT size, T *data,
9696
StridedMemRefType<T, 1> &ref) {
9797
ref.basePtr = ref.data = data;
9898
ref.offset = 0;
99-
using MemrefSizeT = typename std::remove_reference_t<decltype(ref.sizes[0])>;
99+
using MemrefSizeT = std::remove_reference_t<decltype(ref.sizes[0])>;
100100
ref.sizes[0] = detail::checkOverflowCast<MemrefSizeT>(size);
101101
ref.strides[0] = 1;
102102
}

0 commit comments

Comments
 (0)