Skip to content

Commit e4424bf

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:339fc5e6b013 into amd-gfx:a3e65109e75b
Local branch amd-gfx a3e6510 Merged main:08136d822c73 into amd-gfx:5c4b01290188 Remote branch main 339fc5e [test] Mark test added in llvm#67479 as XFAIL
2 parents a3e6510 + 339fc5e commit e4424bf

File tree

218 files changed

+4638
-4956
lines changed

Some content is hidden

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

218 files changed

+4638
-4956
lines changed

bolt/lib/Core/Relocation.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static bool isSupportedRISCV(uint64_t Type) {
109109
case ELF::R_RISCV_HI20:
110110
case ELF::R_RISCV_LO12_I:
111111
case ELF::R_RISCV_LO12_S:
112+
case ELF::R_RISCV_64:
112113
return true;
113114
}
114115
}
@@ -209,6 +210,7 @@ static size_t getSizeForTypeRISCV(uint64_t Type) {
209210
case ELF::R_RISCV_LO12_I:
210211
case ELF::R_RISCV_LO12_S:
211212
return 4;
213+
case ELF::R_RISCV_64:
212214
case ELF::R_RISCV_GOT_HI20:
213215
// See extractValueRISCV for why this is necessary.
214216
return 8;
@@ -364,6 +366,16 @@ static uint64_t encodeValueAArch64(uint64_t Type, uint64_t Value, uint64_t PC) {
364366
return Value;
365367
}
366368

369+
static uint64_t encodeValueRISCV(uint64_t Type, uint64_t Value, uint64_t PC) {
370+
switch (Type) {
371+
default:
372+
llvm_unreachable("unsupported relocation");
373+
case ELF::R_RISCV_64:
374+
break;
375+
}
376+
return Value;
377+
}
378+
367379
static uint64_t extractValueX86(uint64_t Type, uint64_t Contents, uint64_t PC) {
368380
if (Type == ELF::R_X86_64_32S)
369381
return SignExtend64<32>(Contents);
@@ -539,6 +551,7 @@ static uint64_t extractValueRISCV(uint64_t Type, uint64_t Contents,
539551
return SignExtend64<8>(((Contents >> 2) & 0x1f) | ((Contents >> 5) & 0xe0));
540552
case ELF::R_RISCV_ADD32:
541553
case ELF::R_RISCV_SUB32:
554+
case ELF::R_RISCV_64:
542555
return Contents;
543556
}
544557
}
@@ -704,6 +717,7 @@ static bool isPCRelativeRISCV(uint64_t Type) {
704717
case ELF::R_RISCV_HI20:
705718
case ELF::R_RISCV_LO12_I:
706719
case ELF::R_RISCV_LO12_S:
720+
case ELF::R_RISCV_64:
707721
return false;
708722
case ELF::R_RISCV_JAL:
709723
case ELF::R_RISCV_CALL:
@@ -756,7 +770,7 @@ uint64_t Relocation::encodeValue(uint64_t Type, uint64_t Value, uint64_t PC) {
756770
if (Arch == Triple::aarch64)
757771
return encodeValueAArch64(Type, Value, PC);
758772
if (Arch == Triple::riscv64)
759-
llvm_unreachable("not implemented");
773+
return encodeValueRISCV(Type, Value, PC);
760774
return encodeValueX86(Type, Value, PC);
761775
}
762776

@@ -844,6 +858,8 @@ bool Relocation::isPCRelative(uint64_t Type) {
844858
uint64_t Relocation::getAbs64() {
845859
if (Arch == Triple::aarch64)
846860
return ELF::R_AARCH64_ABS64;
861+
if (Arch == Triple::riscv64)
862+
return ELF::R_RISCV_64;
847863
return ELF::R_X86_64_64;
848864
}
849865

bolt/test/RISCV/reloc-64.s

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: llvm-mc -triple riscv64 -filetype=obj -o %t.o %s
2+
// RUN: ld.lld -q -o %t %t.o
3+
// RUN: llvm-bolt -o %t.bolt %t
4+
// RUN: llvm-readelf -s %t.bolt | FileCheck --check-prefix=SYM %s
5+
// RUN: llvm-readelf -x .data %t.bolt | FileCheck --check-prefix=DATA %s
6+
7+
// SYM: {{0+}}400000 {{.*}} _start{{$}}
8+
9+
// DATA: Hex dump of section '.data':
10+
// DATA-NEXT: 00004000 00000000
11+
12+
.data
13+
.globl d
14+
.p2align 3
15+
d:
16+
.dword _start
17+
18+
.text
19+
.globl _start
20+
.p2align 1
21+
_start:
22+
ret
23+
## Dummy relocation to force relocation mode; without it, _start will not be
24+
## moved to a new address.
25+
.reloc 0, R_RISCV_NONE
26+
.size _start, .-_start

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ Improvements to Clang's diagnostics
212212
(`#51567: <https://github.com/llvm/llvm-project/issues/51567>`_)
213213
- Clang now diagnoses narrowing implicit conversions on variable initializers in immediate
214214
function context and on constexpr variable template initializers.
215+
- Clang now prints its 'note' diagnostic in cyan instead of black, to be more compatible
216+
with terminals with dark background colors. This is also more consistent with GCC.
215217

216218
Bug Fixes in This Version
217219
-------------------------

clang/include/clang/Basic/BuiltinsX86.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ TARGET_BUILTIN(__builtin_ia32_minps, "V4fV4fV4f", "ncV:128:", "sse")
233233
TARGET_BUILTIN(__builtin_ia32_maxps, "V4fV4fV4f", "ncV:128:", "sse")
234234
TARGET_BUILTIN(__builtin_ia32_minss, "V4fV4fV4f", "ncV:128:", "sse")
235235
TARGET_BUILTIN(__builtin_ia32_maxss, "V4fV4fV4f", "ncV:128:", "sse")
236+
TARGET_BUILTIN(__builtin_ia32_cmpps, "V4fV4fV4fIc", "ncV:128:", "sse")
237+
TARGET_BUILTIN(__builtin_ia32_cmpss, "V4fV4fV4fIc", "ncV:128:", "sse")
236238

237239
TARGET_BUILTIN(__builtin_ia32_cmpeqpd, "V2dV2dV2d", "ncV:128:", "sse2")
238240
TARGET_BUILTIN(__builtin_ia32_cmpltpd, "V2dV2dV2d", "ncV:128:", "sse2")
@@ -250,6 +252,8 @@ TARGET_BUILTIN(__builtin_ia32_cmpneqsd, "V2dV2dV2d", "ncV:128:", "sse2")
250252
TARGET_BUILTIN(__builtin_ia32_cmpnltsd, "V2dV2dV2d", "ncV:128:", "sse2")
251253
TARGET_BUILTIN(__builtin_ia32_cmpnlesd, "V2dV2dV2d", "ncV:128:", "sse2")
252254
TARGET_BUILTIN(__builtin_ia32_cmpordsd, "V2dV2dV2d", "ncV:128:", "sse2")
255+
TARGET_BUILTIN(__builtin_ia32_cmpsd, "V2dV2dV2dIc", "ncV:128:", "sse2")
256+
TARGET_BUILTIN(__builtin_ia32_cmppd, "V2dV2dV2dIc", "ncV:128:", "sse2")
253257
TARGET_BUILTIN(__builtin_ia32_minpd, "V2dV2dV2d", "ncV:128:", "sse2")
254258
TARGET_BUILTIN(__builtin_ia32_maxpd, "V2dV2dV2d", "ncV:128:", "sse2")
255259
TARGET_BUILTIN(__builtin_ia32_minsd, "V2dV2dV2d", "ncV:128:", "sse2")
@@ -469,12 +473,8 @@ TARGET_BUILTIN(__builtin_ia32_blendvps256, "V8fV8fV8fV8f", "ncV:256:", "avx")
469473
TARGET_BUILTIN(__builtin_ia32_shufpd256, "V4dV4dV4dIi", "ncV:256:", "avx")
470474
TARGET_BUILTIN(__builtin_ia32_shufps256, "V8fV8fV8fIi", "ncV:256:", "avx")
471475
TARGET_BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIc", "ncV:256:", "avx")
472-
TARGET_BUILTIN(__builtin_ia32_cmppd, "V2dV2dV2dIc", "ncV:128:", "avx")
473476
TARGET_BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dIc", "ncV:256:", "avx")
474-
TARGET_BUILTIN(__builtin_ia32_cmpps, "V4fV4fV4fIc", "ncV:128:", "avx")
475477
TARGET_BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fIc", "ncV:256:", "avx")
476-
TARGET_BUILTIN(__builtin_ia32_cmpsd, "V2dV2dV2dIc", "ncV:128:", "avx")
477-
TARGET_BUILTIN(__builtin_ia32_cmpss, "V4fV4fV4fIc", "ncV:128:", "avx")
478478
TARGET_BUILTIN(__builtin_ia32_vextractf128_pd256, "V2dV4dIi", "ncV:256:", "avx")
479479
TARGET_BUILTIN(__builtin_ia32_vextractf128_ps256, "V4fV8fIi", "ncV:256:", "avx")
480480
TARGET_BUILTIN(__builtin_ia32_vextractf128_si256, "V4iV8iIi", "ncV:256:", "avx")

clang/lib/Frontend/TextDiagnostic.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
using namespace clang;
2626

27-
static const enum raw_ostream::Colors noteColor =
28-
raw_ostream::BLACK;
27+
static const enum raw_ostream::Colors noteColor = raw_ostream::CYAN;
2928
static const enum raw_ostream::Colors remarkColor =
3029
raw_ostream::BLUE;
3130
static const enum raw_ostream::Colors fixitColor =

0 commit comments

Comments
 (0)