Skip to content

Commit

Permalink
Add copy metadata helper (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Oct 3, 2022
1 parent 24774ad commit ed3fbb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions enzyme/Enzyme/CApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,4 +710,8 @@ LLVMMetadataRef EnzymeMakeNonConstTBAA(LLVMMetadataRef MD) {
ConstantAsMetadata::get(ConstantInt::get(CAM->getValue()->getType(), 0));
return wrap(MDNode::get(M->getContext(), MDs));
}
void EnzymeCopyMetadata(LLVMValueRef inst1, LLVMValueRef inst2) {
cast<Instruction>(unwrap(inst1))
->copyMetadata(*cast<Instruction>(unwrap(inst2)));
}
}

0 comments on commit ed3fbb5

Please sign in to comment.