This patch enables folding following expressions under -ffast-math flag: exp(X) * exp(Y) -> exp(X + Y), exp2(X) * exp2(Y) -> exp2(X + Y)
Since I'm new to llvm, I looked though other test files, and noticed that it isn't necessary to write full test-check, instead people write just one instruction to make sure test is ok, while consequent instructions doesn't matter. I wonder what style is preferred?
Checks used to be mostly written by hand (and had a lot of shortcomings and bugs because of that). Now that we have scripts to auto-generate checks, I prefer that you use those scripts when possible. It should make subsequent changes or additions to the test file easier for other contributors.
Please cleanup testcases, name all the variables (-instnamer will help)
I think this can still be transformed, as long as at least one of them has only one use.
%2 = call fast double @llvm.exp.f64(double %b) call void @use(double %2) %t1 = add fast double %a, %b %t2 = call fast double @llvm.exp.f64(double %t2) ret double %t2
which has the same number of instruction,
Please add newlines