Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanradanov committed Dec 31, 2023
1 parent 3fd2908 commit 3a6e99a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
12 changes: 7 additions & 5 deletions enzyme/Enzyme/Enzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,17 +1321,19 @@ class EnzymeBase {
if (!F)
return false;
if (CI->arg_size() != 3) {
EmitFailure("TooManyArgs", CI->getDebugLoc(), CI,
"Had incorrect number of args to __enzyme_truncate", *CI,
" - expected 3");
return false;
EmitFailure("TooManyArgs", CI->getDebugLoc(), CI,
"Had incorrect number of args to __enzyme_truncate", *CI,
" - expected 3");
return false;
}
auto Cfrom = cast<ConstantInt>(CI->getArgOperand(1));
assert(Cfrom);
auto Cto = cast<ConstantInt>(CI->getArgOperand(2));
assert(Cto);
RequestContext context(CI, &Builder);
llvm::Value* res = Logic.CreateTruncate(context, F, (unsigned)Cfrom->getValue().getZExtValue(), (unsigned)Cto->getValue().getZExtValue() );
llvm::Value *res = Logic.CreateTruncate(
context, F, (unsigned)Cfrom->getValue().getZExtValue(),
(unsigned)Cto->getValue().getZExtValue());
if (!res)
return false;
res = Builder.CreatePointerCast(res, CI->getType());
Expand Down
4 changes: 2 additions & 2 deletions enzyme/Enzyme/EnzymeLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4835,7 +4835,7 @@ class TruncateGenerator : public llvm::InstVisitor<TruncateGenerator> {
// below

switch (inst.getOpcode()) {
//#include "InstructionDerivatives.inc"
// #include "InstructionDerivatives.inc"
default:
break;
}
Expand Down Expand Up @@ -5132,7 +5132,7 @@ class TruncateGenerator : public llvm::InstVisitor<TruncateGenerator> {
auto called = cast<CallInst>(&I)->getCalledFunction();
(void)called;
switch (ID) {
//#include "IntrinsicDerivatives.inc"
// #include "IntrinsicDerivatives.inc"
default:
break;
}
Expand Down
5 changes: 3 additions & 2 deletions enzyme/Enzyme/EnzymeLogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,9 @@ class EnzymeLogic {

using TruncateCacheKey = std::tuple<llvm::Function *, unsigned, unsigned>;
std::map<TruncateCacheKey, llvm::Function *> TruncateCachedFunctions;
llvm::Function *CreateTruncate(RequestContext context, llvm::Function *tobatch,
unsigned fromwidth, unsigned towidth);
llvm::Function *CreateTruncate(RequestContext context,
llvm::Function *tobatch, unsigned fromwidth,
unsigned towidth);

/// Create a traced version of a function
/// \p context the instruction which requested this trace (or null).
Expand Down

0 comments on commit 3a6e99a

Please sign in to comment.