File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,10 @@ class TargetMachine {
203203 return DL.getPointerSize (DL.getAllocaAddrSpace ());
204204 }
205205
206+ bool hasCheriCapabilities () const {
207+ return DL.hasCheriCapabilities ();
208+ }
209+
206210 // / Reset the target options based on the function's attributes.
207211 // FIXME: Remove TargetOptions that affect per-function code generation
208212 // from TargetMachine.
Original file line number Diff line number Diff line change @@ -510,9 +510,9 @@ 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 &&
513+ // XXX: GlobalMerge is undesirable on CHERI, as it makes the bounds on globals
514+ // excessively loose.
515+ if ((TM->getOptLevel () != CodeGenOptLevel::None && !TM-> hasCheriCapabilities () &&
516516 EnableGlobalMerge == cl::BOU_UNSET) ||
517517 EnableGlobalMerge == cl::BOU_TRUE) {
518518 // FIXME: Like AArch64, we disable extern global merging by default due to
You can’t perform that action at this time.
0 commit comments