Skip to content

Commit

Permalink
Fix build for older llvms (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Mar 17, 2024
1 parent 191dc75 commit 880fb32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions enzyme/Enzyme/GradientUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8968,6 +8968,7 @@ void GradientUtils::eraseWithPlaceholder(Instruction *I, Instruction *orig,
const Twine &suffix, bool erase) {
if (!I->getType()->isVoidTy() && !I->getType()->isTokenTy()) {
auto inspos = I->getIterator();
#if LLVM_VERSION_MAJOR >= 18
if (I->getParent()->IsNewDbgInfoFormat) {
if (!inspos.getHeadBit()) {
auto srcmarker = I->getParent()->getMarker(inspos);
Expand All @@ -8976,6 +8977,7 @@ void GradientUtils::eraseWithPlaceholder(Instruction *I, Instruction *orig,
}
}
}
#endif
IRBuilder<> BuilderZ(I->getParent(), inspos);
auto pn = BuilderZ.CreatePHI(I->getType(), 1, I->getName() + suffix);
fictiousPHIs[pn] = orig;
Expand Down

0 comments on commit 880fb32

Please sign in to comment.