Skip to content

Commit 2f18b78

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:6fbbcb4ee724 into amd-gfx:f8018012cae3
Local branch amd-gfx f801801 Merged main:534c096ec9a6 into amd-gfx:c21ceacdbde5 Remote branch main 6fbbcb4 [TableGen] Fix ordering of register classes. (llvm#67245)
2 parents f801801 + 6fbbcb4 commit 2f18b78

File tree

10 files changed

+16
-33
lines changed

10 files changed

+16
-33
lines changed

clang/lib/AST/Interp/ByteCodeEmitter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "ByteCodeEmitter.h"
10+
#include "ByteCodeGenError.h"
1011
#include "Context.h"
1112
#include "Floating.h"
1213
#include "Opcode.h"
@@ -18,9 +19,6 @@
1819
using namespace clang;
1920
using namespace clang::interp;
2021

21-
using APSInt = llvm::APSInt;
22-
using Error = llvm::Error;
23-
2422
Expected<Function *>
2523
ByteCodeEmitter::compileFunc(const FunctionDecl *FuncDecl) {
2624
// Set up argument indices.

clang/lib/AST/Interp/ByteCodeEmitter.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@
1313
#ifndef LLVM_CLANG_AST_INTERP_LINKEMITTER_H
1414
#define LLVM_CLANG_AST_INTERP_LINKEMITTER_H
1515

16-
#include "ByteCodeGenError.h"
1716
#include "Context.h"
18-
#include "InterpStack.h"
19-
#include "InterpState.h"
2017
#include "PrimType.h"
2118
#include "Program.h"
2219
#include "Source.h"
2320
#include "llvm/Support/Error.h"
2421

2522
namespace clang {
2623
namespace interp {
27-
class Context;
28-
class SourceInfo;
2924
enum Opcode : uint32_t;
3025

3126
/// An emitter which links the program to bytecode for later use.

clang/lib/AST/Interp/ByteCodeStmtGen.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@ bool ByteCodeStmtGen<Emitter>::visitFunc(const FunctionDecl *F) {
171171
} else {
172172
// Non-primitive case. Get a pointer to the field-to-initialize
173173
// on the stack and call visitInitialzer() for it.
174-
if (!this->emitThis(InitExpr))
175-
return false;
176-
177-
if (!this->emitGetPtrField(F->Offset, InitExpr))
174+
if (!this->emitGetPtrThisField(F->Offset, InitExpr))
178175
return false;
179176

180177
if (!this->visitInitializer(InitExpr))

clang/lib/AST/Interp/Context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "Context.h"
1010
#include "ByteCodeEmitter.h"
1111
#include "ByteCodeExprGen.h"
12+
#include "ByteCodeGenError.h"
1213
#include "ByteCodeStmtGen.h"
1314
#include "EvalEmitter.h"
1415
#include "Interp.h"

clang/lib/AST/Interp/Context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
#define LLVM_CLANG_AST_INTERP_CONTEXT_H
1818

1919
#include "InterpStack.h"
20-
#include "clang/AST/APValue.h"
2120

2221
namespace clang {
2322
class ASTContext;
2423
class LangOptions;
2524
class FunctionDecl;
2625
class VarDecl;
26+
class APValue;
2727

2828
namespace interp {
2929
class Function;

clang/lib/AST/Interp/EvalEmitter.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "EvalEmitter.h"
10+
#include "ByteCodeGenError.h"
1011
#include "Context.h"
1112
#include "Interp.h"
1213
#include "Opcode.h"
13-
#include "Program.h"
1414
#include "clang/AST/DeclCXX.h"
1515

1616
using namespace clang;
1717
using namespace clang::interp;
1818

19-
using APSInt = llvm::APSInt;
20-
template <typename T> using Expected = llvm::Expected<T>;
21-
2219
EvalEmitter::EvalEmitter(Context &Ctx, Program &P, State &Parent,
2320
InterpStack &Stk, APValue &Result)
2421
: Ctx(Ctx), P(P), S(Parent, P, Stk, Ctx, this), Result(Result) {

clang/lib/AST/Interp/EvalEmitter.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,17 @@
1313
#ifndef LLVM_CLANG_AST_INTERP_EVALEMITTER_H
1414
#define LLVM_CLANG_AST_INTERP_EVALEMITTER_H
1515

16-
#include "ByteCodeGenError.h"
17-
#include "Context.h"
18-
#include "InterpStack.h"
1916
#include "InterpState.h"
2017
#include "PrimType.h"
21-
#include "Program.h"
2218
#include "Source.h"
2319
#include "llvm/Support/Error.h"
2420

2521
namespace clang {
2622
namespace interp {
2723
class Context;
2824
class Function;
29-
class InterpState;
25+
class InterpStack;
3026
class Program;
31-
class SourceInfo;
3227
enum Opcode : uint32_t;
3328

3429
/// An emitter which evaluates opcodes as they are emitted.

clang/lib/AST/Interp/Function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SourceInfo Function::getSource(CodePtr PC) const {
4444
}
4545

4646
bool Function::isVirtual() const {
47-
if (auto *M = dyn_cast<CXXMethodDecl>(F))
47+
if (const auto *M = dyn_cast<CXXMethodDecl>(F))
4848
return M->isVirtual();
4949
return false;
5050
}

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 475748
19+
#define LLVM_MAIN_REVISION 475753
2020

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

llvm/utils/TableGen/CodeGenRegisters.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,8 +1036,8 @@ void CodeGenRegisterClass::computeSubClasses(CodeGenRegBank &RegBank) {
10361036
std::optional<std::pair<CodeGenRegisterClass *, CodeGenRegisterClass *>>
10371037
CodeGenRegisterClass::getMatchingSubClassWithSubRegs(
10381038
CodeGenRegBank &RegBank, const CodeGenSubRegIndex *SubIdx) const {
1039-
auto SizeOrder = [this](const CodeGenRegisterClass *A,
1040-
const CodeGenRegisterClass *B) {
1039+
auto WeakSizeOrder = [this](const CodeGenRegisterClass *A,
1040+
const CodeGenRegisterClass *B) {
10411041
// If there are multiple, identical register classes, prefer the original
10421042
// register class.
10431043
if (A == B)
@@ -1059,7 +1059,7 @@ CodeGenRegisterClass::getMatchingSubClassWithSubRegs(
10591059
for (auto &RC : RegClasses)
10601060
if (SuperRegRCsBV[RC.EnumValue])
10611061
SuperRegRCs.emplace_back(&RC);
1062-
llvm::stable_sort(SuperRegRCs, SizeOrder);
1062+
llvm::stable_sort(SuperRegRCs, WeakSizeOrder);
10631063

10641064
assert(SuperRegRCs.front() == BiggestSuperRegRC &&
10651065
"Biggest class wasn't first");
@@ -1072,11 +1072,11 @@ CodeGenRegisterClass::getMatchingSubClassWithSubRegs(
10721072
if (SuperRegClassesBV.any())
10731073
SuperRegClasses.push_back(std::make_pair(&RC, SuperRegClassesBV));
10741074
}
1075-
llvm::sort(SuperRegClasses,
1076-
[&](const std::pair<CodeGenRegisterClass *, BitVector> &A,
1077-
const std::pair<CodeGenRegisterClass *, BitVector> &B) {
1078-
return SizeOrder(A.first, B.first);
1079-
});
1075+
llvm::stable_sort(SuperRegClasses,
1076+
[&](const std::pair<CodeGenRegisterClass *, BitVector> &A,
1077+
const std::pair<CodeGenRegisterClass *, BitVector> &B) {
1078+
return WeakSizeOrder(A.first, B.first);
1079+
});
10801080

10811081
// Find the biggest subclass and subreg class such that R:subidx is in the
10821082
// subreg class for all R in subclass.

0 commit comments

Comments
 (0)