Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jan 18, 2024
1 parent f133ea5 commit 8f8c1b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions enzyme/Enzyme/CacheUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ void RemoveRedundantIVs(
add_or_mul->setHasNoUnsignedWrap(true);
if (addrec->getNoWrapFlags(llvm::SCEV::FlagNSW))
add_or_mul->setHasNoSignedWrap(true);
for (int i=0; i<2; i++) {
if (auto mul = dyn_cast<BinaryOperator>(add_or_mul->getOperand(i))) {
if (addrec->getNoWrapFlags(llvm::SCEV::FlagNUW))
mul->setHasNoUnsignedWrap(true);
if (addrec->getNoWrapFlags(llvm::SCEV::FlagNSW))
mul->setHasNoSignedWrap(true);
}
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions enzyme/test/Integration/Sparse/eigen_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ __attribute__((always_inline))
static T eigenstuffM(const T *__restrict__ pos0, size_t n, const int *__restrict__ faces, const T *__restrict__ x) {
T sum = 0;
__builtin_assume(n != 0);
__builtin_assume(n > 0);
for (size_t idx=0; idx<n; idx++) {
int i = faces[3*idx];
int j = faces[3*idx+1];
int k = faces[3*idx+2];
__builtin_assume(idx < 100000000);

/*
T xi = x[i];
Expand Down Expand Up @@ -104,6 +103,7 @@ __attribute__((always_inline))
static T eigenstuffL(const T *__restrict__ x, size_t num_faces, const int *__restrict__ faces, const T *__restrict__ pos0) {
T sum = 0;
__builtin_assume(num_faces != 0);
__builtin_assume(num_faces > 0);
for (size_t idx=0; idx<num_faces; idx++) {
int i = faces[3*idx];
int j = faces[3*idx+1];
Expand Down

0 comments on commit 8f8c1b6

Please sign in to comment.