Skip to content

Commit

Permalink
Make it compile on llvm 11
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanradanov committed Feb 21, 2024
1 parent f0e1674 commit d748629
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion enzyme/Enzyme/Enzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
// the function passed as the first argument.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/ErrorHandling.h"
#include <llvm/Config/llvm-config.h>

#if LLVM_VERSION_MAJOR >= 16
Expand Down Expand Up @@ -59,6 +58,7 @@

#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Transforms/Scalar.h"

#include "llvm/Analysis/BasicAliasAnalysis.h"
Expand Down
6 changes: 3 additions & 3 deletions enzyme/Enzyme/EnzymeLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5203,11 +5203,11 @@ class TruncateGenerator : public llvm::InstVisitor<TruncateGenerator> {
std::string MangledName =
std::string("__enzyme_mpfr_") + truncation.mangleFrom() + "_" + Name;
auto F = newFunc->getParent()->getFunction(MangledName);
SmallVector<Value *> Args(ArgsIn.begin(), ArgsIn.end());
SmallVector<Value *, 4> Args(ArgsIn.begin(), ArgsIn.end());
Args.push_back(B.getInt64(truncation.getTo().exponentWidth));
Args.push_back(B.getInt64(truncation.getTo().significandWidth));
if (!F) {
SmallVector<Type *> ArgTypes;
SmallVector<Type *, 4> ArgTypes;
for (auto Arg : Args)
ArgTypes.push_back(Arg->getType());
FunctionType *FnTy =
Expand Down Expand Up @@ -5251,7 +5251,7 @@ class TruncateGenerator : public llvm::InstVisitor<TruncateGenerator> {
auto newRHS = truncate(B, getNewFromOriginal(oldRHS));
Instruction *nres = nullptr;
if (truncation.isToMPFR()) {
SmallVector<Value *> Args({newLHS, newRHS});
SmallVector<Value *, 2> Args({newLHS, newRHS});
nres = createMPFRCall(B, BO, truncation.getToType(ctx), Args);
} else {
nres = cast<Instruction>(B.CreateBinOp(BO.getOpcode(), newLHS, newRHS));
Expand Down

0 comments on commit d748629

Please sign in to comment.