Skip to content

Commit 0ec399b

Browse files
committed
Enforce opaque IR pointers
1 parent 94af2f8 commit 0ec399b

File tree

5 files changed

+8
-81
lines changed

5 files changed

+8
-81
lines changed

driver/cl_options.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,6 @@ cl::opt<bool> dynamicCompileTlsWorkaround(
710710
cl::Hidden);
711711
#endif
712712

713-
#if LDC_LLVM_VER >= 1700
714-
bool enableOpaqueIRPointers = true; // typed pointers are no longer supported from LLVM 17
715-
#else
716-
bool enableOpaqueIRPointers = false;
717-
#endif
718-
719713
static cl::extrahelp
720714
footer("\n"
721715
"-d-debug can also be specified without options, in which case it "
@@ -775,9 +769,6 @@ void createClashingOptions() {
775769
"Hardware floating-point ABI and instructions")));
776770

777771
renameAndHide("opaque-pointers", nullptr); // remove
778-
new cl::opt<bool, true>(
779-
"opaque-pointers", cl::ZeroOrMore, cl::location(enableOpaqueIRPointers),
780-
cl::desc("Use opaque IR pointers (experimental!)"), cl::Hidden);
781772
}
782773

783774
/// Hides command line options exposed from within LLVM that are unlikely
@@ -865,7 +856,7 @@ void hideLLVMOptions() {
865856
"no-discriminators", "no-integrated-as", "no-type-check", "no-xray-index",
866857
"nozero-initialized-in-bss", "nvptx-sched4reg",
867858
"objc-arc-annotation-target-identifier",
868-
"object-size-offset-visitor-max-visit-instructions", "opaque-pointers",
859+
"object-size-offset-visitor-max-visit-instructions",
869860
"pgo-block-coverage", "pgo-temporal-instrumentation",
870861
"pgo-view-block-coverage-graph",
871862
"pie-copy-relocations", "poison-checking-function-local",

driver/cl_options.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,4 @@ extern cl::opt<bool> dynamicCompileTlsWorkaround;
150150
#else
151151
constexpr bool enableDynamicCompile = false;
152152
#endif
153-
154-
extern bool enableOpaqueIRPointers;
155153
}

driver/main.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,13 @@ void parseCommandLine(Strings &sourceFiles) {
558558
global.params.dihdr.fullOutput = opts::hdrKeepAllBodies;
559559
global.params.disableRedZone = opts::disableRedZone();
560560

561+
// enforce opaque IR pointers
561562
#if LDC_LLVM_VER >= 1700
562-
if (!opts::enableOpaqueIRPointers)
563-
error(Loc(),
564-
"LLVM version 17 or above only supports --opaque-pointers=true");
563+
// supports opaque IR pointers only
565564
#elif LDC_LLVM_VER >= 1500
566-
getGlobalContext().setOpaquePointers(opts::enableOpaqueIRPointers);
567-
#else
568-
if (opts::enableOpaqueIRPointers)
569-
getGlobalContext().enableOpaquePointers();
565+
getGlobalContext().setOpaquePointers(true);
566+
#else // LLVM 14
567+
getGlobalContext().enableOpaquePointers();
570568
#endif
571569
}
572570

tests/codegen/dcompute_cl_addrspaces_new.d renamed to tests/codegen/dcompute_cl_addrspaces.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// UNSUPPORTED: atleast_llvm1800 && atmost_llvm1809
55

66
// REQUIRES: target_SPIRV && atleast_llvm1600
7-
// RUN: %ldc -c -opaque-pointers -mdcompute-targets=ocl-220 -m64 -mdcompute-file-prefix=addrspace_new -output-ll -output-o %s && FileCheck %s --check-prefix=LL < addrspace_new_ocl220_64.ll \
7+
// RUN: %ldc -c -mdcompute-targets=ocl-220 -m64 -mdcompute-file-prefix=addrspace_new -output-ll -output-o %s && FileCheck %s --check-prefix=LL < addrspace_new_ocl220_64.ll \
88
// RUN: && %llc addrspace_new_ocl220_64.ll -mtriple=spirv64-unknown-unknown -O0 -o - | FileCheck %s --check-prefix=SPT
9-
@compute(CompileFor.deviceOnly) module dcompute_cl_addrspaces_new;
9+
@compute(CompileFor.deviceOnly) module dcompute_cl_addrspaces;
1010
import ldc.dcompute;
1111

1212
// LL: %"ldc.dcompute.Pointer!(AddrSpace.Private, float).Pointer" = type { ptr }

tests/codegen/dcompute_cl_addrspaces_old.d

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)