Skip to content

Commit cbe56be

Browse files
authored
Add must cache C ABI (rust-lang#383)
1 parent e344b3d commit cbe56be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

enzyme/Enzyme/CApi.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,11 @@ void EnzymeMoveBefore(LLVMValueRef inst1, LLVMValueRef inst2) {
490490
I1->moveBefore(I2);
491491
}
492492

493+
void EnzymeSetMustCache(LLVMValueRef inst1) {
494+
Instruction *I1 = cast<Instruction>(unwrap(inst1));
495+
I1->setMetadata("enzyme_mustcache", MDNode::get(I1->getContext(), {}));
496+
}
497+
493498
#if LLVM_VERSION_MAJOR >= 9
494499
void EnzymeAddAttributorLegacyPass(LLVMPassManagerRef PM) {
495500
unwrap(PM)->add(createAttributorLegacyPass());

0 commit comments

Comments
 (0)