Skip to content

Commit 447f737

Browse files
authored
Don't replace within defn (rust-lang#561)
1 parent bd9e2b3 commit 447f737

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

enzyme/Enzyme/FunctionUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,8 @@ void PreProcessCache::optimizeIntermediate(Function *F) {
21132113
auto &use = *I;
21142114
++I;
21152115
auto cext = ConstantExpr::getBitCast(&Impl, Specification->getType());
2116+
if (cast<Instruction>(use.getUser())->getParent()->getParent() == &Impl)
2117+
continue;
21162118
use.set(cext);
21172119
if (auto CI = dyn_cast<CallInst>(use.getUser())) {
21182120
#if LLVM_VERSION_MAJOR >= 11

0 commit comments

Comments
 (0)