Skip to content

Commit b5e847e

Browse files
authored
merge main into amd-staging (#676)
2 parents 835ea63 + f008f25 commit b5e847e

File tree

90 files changed

+3312
-693
lines changed

Some content is hidden

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

90 files changed

+3312
-693
lines changed

.github/workflows/gha-codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
sparse-checkout: |
3030
.github/
3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
32+
uses: github/codeql-action/init@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
3333
with:
3434
languages: actions
3535
queries: security-extended
3636
- name: Perform CodeQL Analysis
37-
uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
37+
uses: github/codeql-action/analyze@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4

.github/workflows/libclang-abi-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
needs: abi-dump-setup
8686
runs-on: ubuntu-24.04
8787
container:
88-
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
88+
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:9138b6aea737d935e92ad2afdf5d49325880f9b187b5b979b135ac80cd456135" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
8989
strategy:
9090
matrix:
9191
name:
@@ -129,7 +129,7 @@ jobs:
129129
if: github.repository_owner == 'llvm'
130130
runs-on: ubuntu-24.04
131131
container:
132-
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
132+
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:9138b6aea737d935e92ad2afdf5d49325880f9b187b5b979b135ac80cd456135" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
133133
needs:
134134
- abi-dump-setup
135135
- abi-dump

.github/workflows/llvm-abi-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
needs: abi-dump-setup
7474
runs-on: ubuntu-24.04
7575
container:
76-
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:bb0bd382ab2b"
76+
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:9138b6aea737d935e92ad2afdf5d49325880f9b187b5b979b135ac80cd456135" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:bb0bd382ab2b"
7777
strategy:
7878
matrix:
7979
name:
@@ -133,7 +133,7 @@ jobs:
133133
if: github.repository_owner == 'llvm'
134134
runs-on: ubuntu-24.04
135135
container:
136-
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:bb0bd382ab2b
136+
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:9138b6aea737d935e92ad2afdf5d49325880f9b187b5b979b135ac80cd456135" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:bb0bd382ab2b
137137
needs:
138138
- abi-dump-setup
139139
- abi-dump

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ jobs:
5757

5858
# Upload the results to GitHub's code scanning dashboard.
5959
- name: "Upload to code-scanning"
60-
uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
60+
uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4.31.4
6161
with:
6262
sarif_file: results.sarif

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ autoconf/autom4te.cache
5757
.claude/
5858
/GEMINI.md
5959
.gemini/
60+
AGENTS.md
61+
.codex/
6062

6163
#==============================================================================#
6264
# Directories to ignore (do not add trailing '/'s, they skip symlinks).

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,11 @@ class MCPlusBuilder {
18691869
llvm_unreachable("not implemented");
18701870
}
18711871

1872+
/// Create a BTI landing pad instruction.
1873+
virtual void createBTI(MCInst &Inst, bool CallTarget, bool JumpTarget) const {
1874+
llvm_unreachable("not implemented");
1875+
}
1876+
18721877
/// Store \p Target absolute address to \p RegName
18731878
virtual InstructionListType materializeAddress(const MCSymbol *Target,
18741879
MCContext *Ctx,

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ Error RewriteInstance::readSpecialSections() {
20782078
if (BC->IsStripped && !opts::AllowStripped) {
20792079
BC->errs()
20802080
<< "BOLT-ERROR: stripped binaries are not supported. If you know "
2081-
"what you're doing, use --allow-stripped to proceed";
2081+
"what you're doing, use --allow-stripped to proceed\n";
20822082
exit(1);
20832083
}
20842084

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,6 +2775,13 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
27752775
return Insts;
27762776
}
27772777

2778+
void createBTI(MCInst &Inst, bool CallTarget,
2779+
bool JumpTarget) const override {
2780+
Inst.setOpcode(AArch64::HINT);
2781+
unsigned HintNum = getBTIHintNum(CallTarget, JumpTarget);
2782+
Inst.addOperand(MCOperand::createImm(HintNum));
2783+
}
2784+
27782785
InstructionListType materializeAddress(const MCSymbol *Target, MCContext *Ctx,
27792786
MCPhysReg RegName,
27802787
int64_t Addend = 0) const override {

bolt/unittests/Core/MCPlusBuilder.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,36 @@ TEST_P(MCPlusBuilderTester, AArch64_CmpJE) {
143143
ASSERT_EQ(Label, BB->getLabel());
144144
}
145145

146+
TEST_P(MCPlusBuilderTester, AArch64_BTI) {
147+
if (GetParam() != Triple::aarch64)
148+
GTEST_SKIP();
149+
BinaryFunction *BF = BC->createInjectedBinaryFunction("BF", true);
150+
std::unique_ptr<BinaryBasicBlock> BB = BF->createBasicBlock();
151+
152+
MCInst BTIjc;
153+
BC->MIB->createBTI(BTIjc, true, true);
154+
BB->addInstruction(BTIjc);
155+
auto II = BB->begin();
156+
ASSERT_EQ(II->getOpcode(), AArch64::HINT);
157+
ASSERT_EQ(II->getOperand(0).getImm(), 38);
158+
159+
MCInst BTIj;
160+
BC->MIB->createBTI(BTIj, false, true);
161+
II = BB->addInstruction(BTIj);
162+
ASSERT_EQ(II->getOpcode(), AArch64::HINT);
163+
ASSERT_EQ(II->getOperand(0).getImm(), 36);
164+
165+
MCInst BTIc;
166+
BC->MIB->createBTI(BTIc, true, false);
167+
II = BB->addInstruction(BTIc);
168+
ASSERT_EQ(II->getOpcode(), AArch64::HINT);
169+
ASSERT_EQ(II->getOperand(0).getImm(), 34);
170+
171+
MCInst BTIinvalid;
172+
ASSERT_DEATH(BC->MIB->createBTI(BTIinvalid, false, false),
173+
"No target kinds!");
174+
}
175+
146176
TEST_P(MCPlusBuilderTester, AArch64_CmpJNE) {
147177
if (GetParam() != Triple::aarch64)
148178
GTEST_SKIP();

clang/include/clang/Basic/arm_mve_defs.td

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def immshr: CGHelperFn<"MVEImmediateShr"> {
7474
let special_params = [IRBuilderIntParam<1, "unsigned">,
7575
IRBuilderIntParam<2, "bool">];
7676
}
77-
def fadd: IRBuilder<"CreateFAdd">;
78-
def fmul: IRBuilder<"CreateFMul">;
79-
def fsub: IRBuilder<"CreateFSub">;
77+
def fadd_node: IRBuilder<"CreateFAdd">;
78+
def fmul_node: IRBuilder<"CreateFMul">;
79+
def fsub_node: IRBuilder<"CreateFSub">;
8080
def load: IRBuilder<"CreateLoad"> {
8181
let special_params = [IRBuilderAddrParam<0>];
8282
}
@@ -212,6 +212,13 @@ def unsignedflag;
212212
// constant giving its size in bits.
213213
def bitsize;
214214

215+
// strictFPAlt allows a node to have different code generation under strict-fp.
216+
// TODO: The standard node can be IRBuilderBase or IRIntBase.
217+
class strictFPAlt<IRBuilderBase standard_, IRIntBase strictfp_> {
218+
IRBuilderBase standard = standard_;
219+
IRIntBase strictfp = strictfp_;
220+
}
221+
215222
// If you put CustomCodegen<"foo"> in an intrinsic's codegen field, it
216223
// indicates that the IR generation for that intrinsic is done by handwritten
217224
// C++ and not autogenerated at all. The effect in the MVE builtin codegen
@@ -573,6 +580,14 @@ multiclass IntrinsicMXNameOverride<Type rettype, dag arguments, dag cg,
573580
}
574581
}
575582

583+
// StrictFP nodes that choose between standard fadd and llvm.arm.mve.fadd nodes
584+
// depending on whether we are using strict-fp.
585+
def fadd: strictFPAlt<fadd_node,
586+
IRInt<"vadd", [Vector]>>;
587+
def fsub: strictFPAlt<fsub_node,
588+
IRInt<"vsub", [Vector]>>;
589+
def fmul: strictFPAlt<fmul_node,
590+
IRInt<"vmul", [Vector]>>;
576591

577592
// -----------------------------------------------------------------------------
578593
// Convenience lists of parameter types. 'T' is just a container record, so you

0 commit comments

Comments
 (0)