Skip to content

Commit

Permalink
Put an #ifdef to take into account the LLVM version when using llvm::…
Browse files Browse the repository at this point in the history
…Function::splice.
  • Loading branch information
matinraayai committed Feb 22, 2024
1 parent 6fe2205 commit 50d8829
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions enzyme/Enzyme/Enzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,12 @@ class EnzymeBase {

// Move the truncated body into the original function
F.deleteBody();
#if LLVM_VERSION_MAJOR >= 16
F.splice(F.begin(), TruncatedFunc);
#else
F.getBasicBlockList().splice(F.begin(),
TruncatedFunc->getBasicBlockList());
#endif
RemapFunction(F, Mapping,
RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
TruncatedFunc->deleteBody();
Expand Down Expand Up @@ -2793,31 +2798,22 @@ class EnzymeBase {
/* CGSCC */ nullptr);

DenseSet<const char *> Allowed = {
&AAHeapToStack::ID,
&AANoCapture::ID,

&AAMemoryBehavior::ID,
&AAMemoryLocation::ID,
&AANoUnwind::ID,
&AANoSync::ID,
&AANoRecurse::ID,
&AAWillReturn::ID,
&AANoReturn::ID,
&AANonNull::ID,
&AANoAlias::ID,
&AADereferenceable::ID,
&AAAlign::ID,
&AAHeapToStack::ID, &AANoCapture::ID,

&AAMemoryBehavior::ID, &AAMemoryLocation::ID, &AANoUnwind::ID,
&AANoSync::ID, &AANoRecurse::ID, &AAWillReturn::ID,
&AANoReturn::ID, &AANonNull::ID, &AANoAlias::ID,
&AADereferenceable::ID, &AAAlign::ID,
#if LLVM_VERSION_MAJOR < 17
&AAReturnedValues::ID,
&AAReturnedValues::ID,
#endif
&AANoFree::ID,
&AANoUndef::ID,
&AANoFree::ID, &AANoUndef::ID,

//&AAValueSimplify::ID,
//&AAReachability::ID,
//&AAValueConstantRange::ID,
//&AAUndefinedBehavior::ID,
//&AAPotentialValues::ID,
//&AAValueSimplify::ID,
//&AAReachability::ID,
//&AAValueConstantRange::ID,
//&AAUndefinedBehavior::ID,
//&AAPotentialValues::ID,
};

#if LLVM_VERSION_MAJOR >= 15
Expand Down

0 comments on commit 50d8829

Please sign in to comment.