Skip to content

Commit 4621c36

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/rs1_wb
2 parents e9255bd + 1c17484 commit 4621c36

File tree

6 files changed

+79
-18
lines changed

6 files changed

+79
-18
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ if(COMPILER_RT_USE_LLVM_UNWINDER)
621621
if (COMPILER_RT_ENABLE_STATIC_UNWINDER)
622622
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:unwind_static>")
623623
else()
624-
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:unwind_shared>,unwind_shared,unwind_static>>")
624+
list(APPEND COMPILER_RT_UNWINDER_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBUNWIND_ENABLE_SHARED}>,unwind_shared,unwind_static>>")
625625
endif()
626626
endif()
627627

@@ -634,7 +634,7 @@ if (COMPILER_RT_CXX_LIBRARY STREQUAL "libcxx")
634634
if (COMPILER_RT_STATIC_CXX_LIBRARY)
635635
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:cxx_static>")
636636
else()
637-
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:cxx_shared>,cxx_shared,cxx_static>>")
637+
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBCXX_ENABLE_SHARED}>,cxx_shared,cxx_static>>")
638638
endif()
639639
elseif (COMPILER_RT_CXX_LIBRARY STREQUAL "none")
640640
# We aren't using any C++ standard library so avoid including the default one.
@@ -676,7 +676,7 @@ if (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libc++")
676676
if (SANITIZER_USE_STATIC_TEST_CXX)
677677
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:cxx_static>")
678678
else()
679-
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<TARGET_EXISTS:cxx_shared>,cxx_shared,cxx_static>>")
679+
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:$<IF:$<BOOL:${LIBCXX_ENABLE_SHARED}>,cxx_shared,cxx_static>>")
680680
endif()
681681
# We are using the in tree libc++ so avoid including the default one.
682682
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_UNITTEST_CFLAGS)

compiler-rt/lib/sanitizer_common/sanitizer_win.cpp

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag() const {
10341034

10351035
void SignalContext::DumpAllRegisters(void *context) {
10361036
CONTEXT *ctx = (CONTEXT *)context;
1037-
# if defined(__M_X64)
1037+
# if defined(_M_X64)
10381038
Report("Register values:\n");
10391039
Printf("rax = %llx ", ctx->Rax);
10401040
Printf("rbx = %llx ", ctx->Rbx);
@@ -1068,6 +1068,41 @@ void SignalContext::DumpAllRegisters(void *context) {
10681068
Printf("ebp = %lx ", ctx->Ebp);
10691069
Printf("esp = %lx ", ctx->Esp);
10701070
Printf("\n");
1071+
# elif defined(_M_ARM64)
1072+
Report("Register values:\n");
1073+
Printf("x0 = %llx ", ctx->X0);
1074+
Printf("x1 = %llx ", ctx->X1);
1075+
Printf("x2 = %llx ", ctx->X2);
1076+
Printf("x3 = %llx ", ctx->X3);
1077+
Printf("x4 = %llx ", ctx->X4);
1078+
Printf("x5 = %llx ", ctx->X5);
1079+
Printf("x6 = %llx ", ctx->X6);
1080+
Printf("x7 = %llx ", ctx->X7);
1081+
Printf("x8 = %llx ", ctx->X8);
1082+
Printf("x9 = %llx ", ctx->X9);
1083+
Printf("x10 = %llx ", ctx->X10);
1084+
Printf("x11 = %llx ", ctx->X11);
1085+
Printf("x12 = %llx ", ctx->X12);
1086+
Printf("x13 = %llx ", ctx->X13);
1087+
Printf("x14 = %llx ", ctx->X14);
1088+
Printf("x15 = %llx ", ctx->X15);
1089+
Printf("x16 = %llx ", ctx->X16);
1090+
Printf("x17 = %llx ", ctx->X17);
1091+
Printf("x18 = %llx ", ctx->X18);
1092+
Printf("x19 = %llx ", ctx->X19);
1093+
Printf("x20 = %llx ", ctx->X20);
1094+
Printf("x21 = %llx ", ctx->X21);
1095+
Printf("x22 = %llx ", ctx->X22);
1096+
Printf("x23 = %llx ", ctx->X23);
1097+
Printf("x24 = %llx ", ctx->X24);
1098+
Printf("x25 = %llx ", ctx->X25);
1099+
Printf("x26 = %llx ", ctx->X26);
1100+
Printf("x27 = %llx ", ctx->X27);
1101+
Printf("x28 = %llx ", ctx->X28);
1102+
Printf("x29 = %llx ", ctx->X29);
1103+
Printf("x30 = %llx ", ctx->X30);
1104+
Printf("x31 = %llx ", ctx->X31);
1105+
Printf("\n");
10711106
# else
10721107
// TODO
10731108
(void)ctx;

compiler-rt/test/fuzzer/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ endmacro()
7373

7474
test_fuzzer("default")
7575
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
76-
if(TARGET cxx_shared)
76+
if(LIBCXX_ENABLE_SHARED)
7777
test_fuzzer("libc++" DEPS cxx_shared)
7878
endif()
79-
if(TARGET cxx_static)
79+
if(LIBCXX_ENABLE_STATIC)
8080
test_fuzzer("static-libc++" DEPS cxx_static)
8181
endif()
8282
endif()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Check that sanitizer prints registers dump_registers on dump_registers=1
2+
// RUN: %clangxx %s -o %t
3+
// RUN: %env_tool_opts=dump_registers=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP
4+
// RUN: not %run %t 2>&1 | FileCheck %s --strict-whitespace --check-prefix=CHECK-DUMP
5+
//
6+
// REQUIRES: aarch64-pc-windows-msvc
7+
8+
#include <windows.h>
9+
10+
int main() {
11+
RaiseException(EXCEPTION_ACCESS_VIOLATION, 0, 0, NULL);
12+
// CHECK-DUMP: Register values
13+
// CHECK-DUMP-NEXT: x0 = {{0x[0-9a-f]+}} x1 = {{0x[0-9a-f]+}} x2 = {{0x[0-9a-f]+}} x3 = {{0x[0-9a-f]+}}
14+
// CHECK-DUMP-NEXT: x4 = {{0x[0-9a-f]+}} x5 = {{0x[0-9a-f]+}} x6 = {{0x[0-9a-f]+}} x7 = {{0x[0-9a-f]+}}
15+
// CHECK-DUMP-NEXT: x8 = {{0x[0-9a-f]+}} x9 = {{0x[0-9a-f]+}} x10 = {{0x[0-9a-f]+}} x11 = {{0x[0-9a-f]+}}
16+
// CHECK-DUMP-NEXT:x12 = {{0x[0-9a-f]+}} x13 = {{0x[0-9a-f]+}} x14 = {{0x[0-9a-f]+}} x15 = {{0x[0-9a-f]+}}
17+
// CHECK-DUMP-NEXT:x16 = {{0x[0-9a-f]+}} x17 = {{0x[0-9a-f]+}} x18 = {{0x[0-9a-f]+}} x19 = {{0x[0-9a-f]+}}
18+
// CHECK-DUMP-NEXT:x20 = {{0x[0-9a-f]+}} x21 = {{0x[0-9a-f]+}} x22 = {{0x[0-9a-f]+}} x23 = {{0x[0-9a-f]+}}
19+
// CHECK-DUMP-NEXT:x24 = {{0x[0-9a-f]+}} x25 = {{0x[0-9a-f]+}} x26 = {{0x[0-9a-f]+}} x27 = {{0x[0-9a-f]+}}
20+
// CHECK-DUMP-NEXT:x28 = {{0x[0-9a-f]+}} fp = {{0x[0-9a-f]+}} lr = {{0x[0-9a-f]+}} sp = {{0x[0-9a-f]+}}
21+
// CHECK-NODUMP-NOT: Register values
22+
return 0;
23+
}

lld/wasm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_lld_library(lldWasm
2828
Object
2929
Option
3030
Passes
31+
ProfileData
3132
Support
3233
TargetParser
3334

llvm/lib/Target/RISCV/RISCVInstrInfoC.td

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ def C_SD : CStore_rri<0b111, "c.sd", GPRC, uimm8_lsb000>,
401401
let Inst{6-5} = imm{7-6};
402402
}
403403

404-
let rd = 0, imm = 0, hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
404+
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
405405
def C_NOP : RVInst16CI<0b000, 0b01, (outs), (ins), "c.nop", "">,
406406
Sched<[WriteNop]> {
407+
let rd = 0;
408+
let imm = 0;
407409
let Inst{6-2} = 0;
408410
}
409411

@@ -639,9 +641,9 @@ def C_UNIMP : RVInst16<(outs), (ins), "c.unimp", "", [], InstFormatOther>,
639641
let Predicates = [HasStdExtCOrZca, HasRVCHints], hasSideEffects = 0, mayLoad = 0,
640642
mayStore = 0 in {
641643

642-
let rd = 0 in
643644
def C_NOP_HINT : RVInst16CI<0b000, 0b01, (outs), (ins simm6nonzero:$imm),
644645
"c.nop", "$imm">, Sched<[WriteNop]> {
646+
let rd = 0;
645647
let Inst{6-2} = imm{4-0};
646648
}
647649

@@ -705,23 +707,23 @@ def C_SLLI64_HINT : RVInst16CI<0b000, 0b10, (outs GPR:$rd_wb), (ins GPR:$rd),
705707
let Inst{12} = 0;
706708
}
707709

708-
def C_SRLI64_HINT : RVInst16CI<0b100, 0b01, (outs GPRC:$rd_wb),
709-
(ins GPRC:$rd),
710-
"c.srli64", "$rd">,
710+
def C_SRLI64_HINT : RVInst16CB<0b100, 0b01, (outs GPRC:$rd),
711+
(ins GPRC:$rs1),
712+
"c.srli64", "$rs1">,
711713
Sched<[WriteShiftImm, ReadShiftImm]> {
712-
let Constraints = "$rd = $rd_wb";
714+
let Constraints = "$rs1 = $rd";
713715
let Inst{6-2} = 0;
714-
let Inst{11-10} = 0;
716+
let Inst{11-10} = 0b00;
715717
let Inst{12} = 0;
716718
}
717719

718-
def C_SRAI64_HINT : RVInst16CI<0b100, 0b01, (outs GPRC:$rd_wb),
719-
(ins GPRC:$rd),
720-
"c.srai64", "$rd">,
720+
def C_SRAI64_HINT : RVInst16CB<0b100, 0b01, (outs GPRC:$rd),
721+
(ins GPRC:$rs1),
722+
"c.srai64", "$rs1">,
721723
Sched<[WriteShiftImm, ReadShiftImm]> {
722-
let Constraints = "$rd = $rd_wb";
724+
let Constraints = "$rs1 = $rd";
723725
let Inst{6-2} = 0;
724-
let Inst{11-10} = 1;
726+
let Inst{11-10} = 0b01;
725727
let Inst{12} = 0;
726728
}
727729

0 commit comments

Comments
 (0)