File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ class TargetMachine {
203203 return DL.getPointerSize (DL.getAllocaAddrSpace ());
204204 }
205205
206+ bool hasCheriCapabilities () const { return DL.hasCheriCapabilities (); }
207+
206208 // / Reset the target options based on the function's attributes.
207209 // FIXME: Remove TargetOptions that affect per-function code generation
208210 // from TargetMachine.
Original file line number Diff line number Diff line change @@ -510,10 +510,10 @@ bool RISCVPassConfig::addPreISel() {
510510 addPass (createBarrierNoopPass ());
511511 }
512512
513- bool isCheriot =
514- TM-> getTargetTriple (). getSubArch () == Triple::RISCV32SubArch_cheriot_v1;
515- if ((TM->getOptLevel () != CodeGenOptLevel::None && !isCheriot &&
516- EnableGlobalMerge == cl::BOU_UNSET) ||
513+ // XXX: GlobalMerge is undesirable on CHERI, as it makes the bounds on globals
514+ // excessively loose.
515+ if ((TM->getOptLevel () != CodeGenOptLevel::None &&
516+ !TM-> hasCheriCapabilities () && EnableGlobalMerge == cl::BOU_UNSET) ||
517517 EnableGlobalMerge == cl::BOU_TRUE) {
518518 // FIXME: Like AArch64, we disable extern global merging by default due to
519519 // concerns it might regress some workloads. Unlike AArch64, we don't
You can’t perform that action at this time.
0 commit comments