Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparsefix more benchmarks #1610

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7c9d831
tmp
wsmoses Jan 8, 2024
75d9bc0
progress
wsmoses Jan 8, 2024
e940f5a
fixed memory issue
wsmoses Jan 8, 2024
9d0aa84
nicer errors
wsmoses Jan 8, 2024
88eda75
add a simplified test case
martinjm97 Jan 8, 2024
58345d7
wip
martinjm97 Jan 9, 2024
cb1a82d
get rid of args in tests
martinjm97 Jan 9, 2024
46e713f
static and inline everywhere
martinjm97 Jan 9, 2024
0ce3c7d
logic fix
wsmoses Jan 9, 2024
a55bf0e
fix logic error
wsmoses Jan 9, 2024
5c97d25
fix
wsmoses Jan 9, 2024
20b4f9b
add or replace rule
wsmoses Jan 9, 2024
b075224
fix compile error
martinjm97 Jan 9, 2024
bd420d8
fdiv sparse prop
wsmoses Jan 9, 2024
db317aa
mul const const
wsmoses Jan 9, 2024
035fb87
fixup
wsmoses Jan 9, 2024
868af98
reverse distribution
martinjm97 Jan 9, 2024
efa4fe4
fix order bug
wsmoses Jan 9, 2024
0a634a8
mulconstconst optimization
martinjm97 Jan 9, 2024
e536b82
fix rotate
wsmoses Jan 9, 2024
fe1ed67
fix
wsmoses Jan 9, 2024
0c6114c
extend constraint language
wsmoses Jan 9, 2024
c91b9e4
fixup
wsmoses Jan 10, 2024
1eef874
Graphics benchmarks
martinjm97 Jan 10, 2024
c4fbce6
make it so that the tests rung
martinjm97 Jan 10, 2024
a9507ae
continued simplify
wsmoses Jan 10, 2024
aa107bc
canonicalize combine
wsmoses Jan 10, 2024
d533c91
yay
martinjm97 Jan 10, 2024
700b660
Merge branch 'sparsefix' into sparsefix_more_benchmarks
martinjm97 Jan 10, 2024
f56e736
fmuladdlowering
martinjm97 Jan 10, 2024
de8d52d
Ring of springs integration test using modulo
martinjm97 Nov 3, 2023
87191d9
merge
martinjm97 Jan 16, 2024
5f6cfe9
merge
martinjm97 Jan 16, 2024
1cead75
Merge branch 'main' into sparsefix_more_benchmarks
martinjm97 Jan 16, 2024
57184ed
fixup
wsmoses Jan 16, 2024
10b58f3
change header
wsmoses Jan 16, 2024
a7b6d2e
simplify test
wsmoses Jan 16, 2024
2947b9f
improve tests and errors
wsmoses Jan 16, 2024
37a0aa4
triple fix
wsmoses Jan 16, 2024
be4e8d1
merged
martinjm97 Jan 16, 2024
fa8e6af
remove prints
martinjm97 Jan 16, 2024
c36bdb7
cloth working
martinjm97 Jan 16, 2024
dfa369a
validated eigen analysis
martinjm97 Jan 16, 2024
ce993d4
affine
martinjm97 Jan 16, 2024
098af17
fix hessian to take the deriv of the right params
martinjm97 Jan 17, 2024
6a54e0a
add postdense support
wsmoses Jan 17, 2024
0753060
fix argument order for eigenstuffL
martinjm97 Jan 17, 2024
68a51a0
Merge branch 'main' into sparsefix_more_benchmarks
wsmoses Jan 17, 2024
031a48b
Add simpler version of cloth (initial commit)
Jan 17, 2024
605ca64
Checkpoint
Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fmuladdlowering
  • Loading branch information
martinjm97 committed Jan 10, 2024
commit f56e73650fd5da0a32d92b3621d50101572c3a2b
19 changes: 19 additions & 0 deletions enzyme/Enzyme/FunctionUtils.cpp
Original file line number Diff line number Diff line change
@@ -3009,6 +3009,25 @@ std::optional<std::string> fixSparse_inner(Instruction *cur, llvm::Function &F,
return val;
};

// fmuladd a b c -> fadd (fmul a, b), c
if (auto II = dyn_cast<IntrinsicInst>(cur)) {
if (II->getIntrinsicID() == Intrinsic::fma || II->getIntrinsicID() == Intrinsic::fmuladd){
auto a = II->getOperand(0);
auto b = II->getOperand(1);
auto c = II->getOperand(2);
auto ab_I = cast<BinaryOperator>(B.CreateFMul(a, b));
ab_I->setFast(true);
auto ab = pushcse(ab_I);
auto res_I = cast<BinaryOperator>(B.CreateFAdd(ab, c));
res_I->setFast(true);
auto res = pushcse(res_I);
push(ab);
push(res);
replaceAndErase(cur, res);
return "FMulAddLower";
}
}

// mul (mul a, const1), (mul b, const2) -> mul (mul a, b), (const1, const2)
if (cur->getOpcode() == Instruction::FMul)
if (cur->isFast())