Skip to content

Commit dc92fc8

Browse files
authored
Merge branch 'main' into main-merge-true16-mc-vop1-more-instruction-3
2 parents 0082677 + 9d8e634 commit dc92fc8

File tree

2,826 files changed

+79215
-36208
lines changed

Some content is hidden

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

2,826 files changed

+79215
-36208
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
config: [
46+
'frozen-cxx03-headers',
4647
'generic-cxx03',
4748
'generic-cxx26',
4849
'generic-modules'

bolt/docs/CommandLineArgumentReference.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -931,15 +931,6 @@
931931

932932
Remove redundant Address-Size override prefix
933933

934-
### BOLT options in relocation mode:
935-
936-
- `--align-macro-fusion=<value>`
937-
938-
Fix instruction alignment for macro-fusion (x86 relocation mode)
939-
- `none`: do not insert alignment no-ops for macro-fusion
940-
- `hot`: only insert alignment no-ops on hot execution paths (default)
941-
- `all`: always align instructions to allow macro-fusion
942-
943934
### BOLT instrumentation options:
944935

945936
`llvm-bolt <executable> -instrument [-o outputfile] <instrumented-executable>`

bolt/include/bolt/Core/BinaryData.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ class BinaryData {
169169
return Parent && (Parent == BD || Parent->isAncestorOf(BD));
170170
}
171171

172+
void updateSize(uint64_t N) {
173+
if (N > Size)
174+
Size = N;
175+
}
176+
172177
void setIsMoveable(bool Flag) { IsMoveable = Flag; }
173178
void setSection(BinarySection &NewSection);
174179
void setOutputSection(BinarySection &NewSection) {

bolt/lib/Core/BinaryContext.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ MCSymbol *BinaryContext::registerNameAtAddress(StringRef Name, uint64_t Address,
10761076
BD = GAI->second;
10771077
if (!BD->hasName(Name)) {
10781078
GlobalSymbols[Name] = BD;
1079+
BD->updateSize(Size);
10791080
BD->Symbols.push_back(Symbol);
10801081
}
10811082
}
@@ -1961,7 +1962,15 @@ void BinaryContext::printInstruction(raw_ostream &OS, const MCInst &Instruction,
19611962
OS << "\tjit\t" << MIB->getTargetSymbol(Instruction)->getName()
19621963
<< " # ID: " << DynamicID;
19631964
} else {
1964-
InstPrinter->printInst(&Instruction, 0, "", *STI, OS);
1965+
// If there are annotations on the instruction, the MCInstPrinter will fail
1966+
// to print the preferred alias as it only does so when the number of
1967+
// operands is as expected. See
1968+
// https://github.com/llvm/llvm-project/blob/782f1a0d895646c364a53f9dcdd6d4ec1f3e5ea0/llvm/lib/MC/MCInstPrinter.cpp#L142
1969+
// Therefore, create a temporary copy of the Inst from which the annotations
1970+
// are removed, and print that Inst.
1971+
MCInst InstNoAnnot = Instruction;
1972+
MIB->stripAnnotations(InstNoAnnot);
1973+
InstPrinter->printInst(&InstNoAnnot, 0, "", *STI, OS);
19651974
}
19661975
if (MIB->isCall(Instruction)) {
19671976
if (MIB->isTailCall(Instruction))

bolt/lib/Core/Relocation.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ static bool isSupportedAArch64(uint64_t Type) {
7575
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
7676
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
7777
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
78+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
79+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
7880
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
7981
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
8082
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
@@ -183,6 +185,8 @@ static size_t getSizeForTypeAArch64(uint64_t Type) {
183185
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
184186
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
185187
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
188+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
189+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
186190
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
187191
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
188192
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
@@ -651,6 +655,8 @@ static bool isTLSAArch64(uint64_t Type) {
651655
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
652656
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
653657
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
658+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
659+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
654660
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
655661
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
656662
case ELF::R_AARCH64_TLSDESC_CALL:
@@ -716,6 +722,8 @@ static bool isPCRelativeAArch64(uint64_t Type) {
716722
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
717723
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
718724
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
725+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
726+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
719727
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
720728
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
721729
case ELF::R_AARCH64_TLSDESC_ADD_LO12:

0 commit comments

Comments
 (0)