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 0de6d44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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

0 comments on commit 0de6d44

Please sign in to comment.