[PATCH] D62699: [InlineCost] Add support for UnaryOperator
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 13:31:27 PDT 2019
craig.topper created this revision.
craig.topper added reviewers: cameron.mcinally, spatel, fhahn, bjope, efriedma.
Herald added subscribers: haicheng, hiraditya, kristof.beyls, eraman, javed.absar.
Herald added a project: LLVM.
This adds support for UnaryOperator in InlineCost similar to what is done for BinaryOperator. This allows fastmath flags to be passed to SimplifyInstruction and for the cost to be increased when fp is expensive.
Currently the only UnaryOperator is fneg and the code for it in SimplifyInstruction doesn't use fast math flags so I dont' know how to test that part.
I was able to test the increased fp cost. The included test case will report a cost of 100 before this patch and 125 after this patch. I based this on an earlier arm test case in the test file and just changed an fmul by constant to an fneg. I can pre-commit this test but wanted opinions on if this test needs changes.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5870 bytes
Desc: not available
More information about the llvm-commits