[PATCH] D133300: [InstCombine] Matrix multiplication negation optimisation

Zain Jaffal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 06:50:10 PDT 2022


zjaffal updated this revision to Diff 461557.
zjaffal added a comment.

Refactor the code for moving negation to the result. Now we preserve the fastmath flags on the created multiplication and negation instructions by passing them from the original multiplication instruction. `FNeg` is created using `Builder` instead of `UnitaryOperand` because 
the latter caused build failures. 
The changes in the fastflag behaviour can be seen on `test_negation_move_to_result_with_fastflags` test.

I added another 3 test cases using a subset of the fast flags and the flags on the negation instruction instead of the multiplication.

1. `test_negation_move_to_result_with_nnan_flag`
2. `test_negation_move_to_result_with_nsz_flag`
3. `test_negation_move_to_result_with_fastflag_on_negation`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133300/new/

https://reviews.llvm.org/D133300

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/test/Transforms/InstCombine/matrix-multiplication-negation.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133300.461557.patch
Type: text/x-patch
Size: 13687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220920/b6a03a69/attachment.bin>


More information about the llvm-commits mailing list