Skip to content

Commit 880fb32

Browse files
authored
Fix build for older llvms (#1795)
1 parent 191dc75 commit 880fb32

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

enzyme/Enzyme/GradientUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8968,6 +8968,7 @@ void GradientUtils::eraseWithPlaceholder(Instruction *I, Instruction *orig,
89688968
const Twine &suffix, bool erase) {
89698969
if (!I->getType()->isVoidTy() && !I->getType()->isTokenTy()) {
89708970
auto inspos = I->getIterator();
8971+
#if LLVM_VERSION_MAJOR >= 18
89718972
if (I->getParent()->IsNewDbgInfoFormat) {
89728973
if (!inspos.getHeadBit()) {
89738974
auto srcmarker = I->getParent()->getMarker(inspos);
@@ -8976,6 +8977,7 @@ void GradientUtils::eraseWithPlaceholder(Instruction *I, Instruction *orig,
89768977
}
89778978
}
89788979
}
8980+
#endif
89798981
IRBuilder<> BuilderZ(I->getParent(), inspos);
89808982
auto pn = BuilderZ.CreatePHI(I->getType(), 1, I->getName() + suffix);
89818983
fictiousPHIs[pn] = orig;

0 commit comments

Comments
 (0)