Skip to content

Commit feed0ce

Browse files
authored
fix constexpr handling (rust-lang#659)
* closes rust-lang#657 * Handle vector case * adding test * remove test until further bugfixes
1 parent 0457e36 commit feed0ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

enzyme/Enzyme/GradientUtils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3821,6 +3821,11 @@ Value *GradientUtils::invertPointerM(Value *const oval, IRBuilder<> &BuilderM,
38213821
}
38223822
}
38233823

3824+
if (auto arg = dyn_cast<ConstantExpr>(oval)) {
3825+
auto rule = [&oval]() { return oval; };
3826+
return applyChainRule(oval->getType(), BuilderM, rule);
3827+
}
3828+
38243829
Value *newval = getNewFromOriginal(oval);
38253830

38263831
auto rule = [&]() { return newval; };

0 commit comments

Comments
 (0)