Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some more LLVM 18 fixes #4607

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions driver/cl_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,15 +811,15 @@ void hideLLVMOptions() {
"amdgpu-dump-hsa-metadata", "amdgpu-enable-flat-scratch",
"amdgpu-enable-global-sgpr-addr", "amdgpu-enable-merge-m0",
"amdgpu-enable-power-sched", "amdgpu-igrouplp",
"amdgpu-promote-alloca-to-vector-limit",
"amdgpu-kernarg-preload-count", "amdgpu-promote-alloca-to-vector-limit",
"amdgpu-reserve-vgpr-for-sgpr-spill", "amdgpu-sdwa-peephole",
"amdgpu-use-aa-in-codegen", "amdgpu-verify-hsa-metadata",
"amdgpu-vgpr-index-mode", "arm-add-build-attributes",
"arm-implicit-it", "asm-instrumentation", "asm-show-inst",
"atomic-counter-update-promoted", "atomic-first-counter",
"basic-block-sections",
"basicblock-sections", "bounds-checking-single-trap", "bpf-stack-size",
"cfg-hide-cold-paths",
"basicblock-sections", "bounds-checking-single-trap",
"bounds-checking-unique-traps", "bpf-stack-size", "cfg-hide-cold-paths",
"cfg-hide-deoptimize-paths", "cfg-hide-unreachable-paths",
"code-model", "cost-kind", "cppfname", "cppfor", "cppgen",
"cvp-dont-add-nowrap-flags",
Expand Down Expand Up @@ -847,10 +847,11 @@ void hideLLVMOptions() {
"enable-no-nans-fp-math", "enable-no-signed-zeros-fp-math",
"enable-no-trapping-fp-math", "enable-objc-arc-annotations",
"enable-objc-arc-opts", "enable-pie", "enable-scoped-noalias",
"enable-split-backedge-in-load-pre",
"enable-tbaa", "enable-unsafe-fp-math", "exception-model",
"exhaustive-register-search", "expensive-combines",
"enable-split-backedge-in-load-pre", "enable-split-loopiv-heuristic",
"enable-tbaa", "enable-tlsdesc", "enable-unsafe-fp-math",
"exception-model", "exhaustive-register-search", "expensive-combines",
"experimental-debug-variable-locations",
"experimental-debuginfo-iterators",
"fatal-assembler-warnings", "filter-print-funcs",
"force-dwarf-frame-section", "force-opaque-pointers",
"force-tail-folding-style",
Expand All @@ -867,8 +868,8 @@ void hideLLVMOptions() {
"instcombine-negator-max-depth", "instcombine-unsafe-select-transform",
"instrprof-atomic-counter-update-all", "internalize-public-api-file",
"internalize-public-api-list", "iterative-counter-promotion",
"join-liveintervals", "jump-table-type", "limit-float-precision",
"lower-global-dtors-via-cxa-atexit",
"join-liveintervals", "jump-table-type", "large-data-threshold",
"limit-float-precision", "lower-global-dtors-via-cxa-atexit",
"lto-embed-bitcode", "matrix-default-layout",
"matrix-print-after-transpose-opt", "matrix-propagate-shape",
"max-counter-promotions", "max-counter-promotions-per-loop",
Expand All @@ -881,20 +882,21 @@ void hideLLVMOptions() {
"mwarn-noncontigious-register", "mwarn-sign-mismatch", "mxcoff-roptr",
"no-discriminators", "no-integrated-as", "no-type-check", "no-xray-index",
"nozero-initialized-in-bss", "nvptx-sched4reg",
"objc-arc-annotation-target-identifier", "opaque-pointers",
"objc-arc-annotation-target-identifier",
"object-size-offset-visitor-max-visit-instructions", "opaque-pointers",
"pgo-block-coverage", "pgo-temporal-instrumentation",
"pgo-view-block-coverage-graph",
"pie-copy-relocations", "poison-checking-function-local",
"polly-dump-after", "polly-dump-after-file", "polly-dump-before",
"polly-dump-before-file", "pre-RA-sched", "print-after-all",
"print-before-all", "print-machineinstrs", "print-module-scope",
"print-pipeline-passes",
"print-pipeline-passes", "profile-correlate",
"profile-estimator-loop-weight", "profile-estimator-loop-weight",
"profile-file", "profile-info-file", "profile-verifier-noassert",
"pseudo-probe-for-profiling",
"r600-ir-structurize", "rdf-dump", "rdf-limit", "recip", "regalloc",
"relax-elf-relocations", "remarks-section", "rewrite-map-file",
"riscv-add-build-attributes", "rng-seed",
"riscv-add-build-attributes", "riscv-use-aa", "rng-seed",
"runtime-counter-relocation", "safepoint-ir-verifier-print-only",
"sample-profile-check-record-coverage",
"sample-profile-check-sample-coverage",
Expand Down
4 changes: 4 additions & 0 deletions runtime/druntime/src/ldc/profile.di
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ extern(C++) struct ProfileData {
{
ulong* Counters;
}
static if (LLVM_version >= 1800)
void* BitmapPtr;
void* FunctionPointer;
void* Values;
uint NumCounters;
ushort NumValueSites;
static if (LLVM_version >= 1800)
uint NumBitmapBytes;
}

// Symbols provided by profile-rt lib
Expand Down
18 changes: 10 additions & 8 deletions tests/codegen/cmpxchg.d
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ import core.atomic;
bool foo(int cmp)
{
static shared int g;
// CHECK-NEXT: %1 = cmpxchg {{i32\*|ptr}}
// CHECK-NEXT: %2 = extractvalue { i32, i1 } %1, 1
// CHECK-NEXT: ret i1 %2
// CHECK-NOT: ret
// CHECK: [[FOO1:%[0-9]]] = cmpxchg {{i32\*|ptr}}
// CHECK-NEXT: [[FOO2:%[0-9]]] = extractvalue { i32, i1 } [[FOO1]], 1
// CHECK-NEXT: ret i1 [[FOO2]]
return cas(&g, cmp, 456);
}

// CHECK: define {{.*}}_D7cmpxchg3barFdZd
double bar(double cmp)
{
static shared double g;
// CHECK-NEXT: %1 = bitcast double %cmp_arg to i64
// CHECK-NEXT: %2 = cmpxchg weak {{i64\*|ptr}}
// CHECK-NOT: ret
// CHECK: [[BAR1:%[0-9]]] = bitcast double %cmp_arg to i64
// CHECK-NEXT: [[BAR2:%[0-9]]] = cmpxchg weak {{i64\*|ptr}}
casWeak(&g, &cmp, 456.0);
// CHECK-NEXT: %3 = extractvalue { i64, i1 } %2, 0
// CHECK-NEXT: %4 = bitcast i64 %3 to double
// CHECK-NEXT: ret double %4
// CHECK-NEXT: [[BAR3:%[0-9]]] = extractvalue { i64, i1 } [[BAR2]], 0
// CHECK-NEXT: [[BAR4:%[0-9]]] = bitcast i64 [[BAR3]] to double
// CHECK-NEXT: ret double [[BAR4]]
return cmp;
}
Loading