Update on A * (1 - uitofp i1 C) + B * uitofp i1 C —> select C, B, A

Jean-Luc Duprat jduprat at apple.com
Tue May 21 19:03:13 PDT 2013


This is an update to a previous commit (r181216).

The earlier change list introduced the following inst combines:
B * (uitofp i1 C) —> select C, B, 0
A * (1 - uitofp i1 C) —> select C, 0, A
select C, 0, B + select C, A, 0 —> select C, A, B

Together these 3 changes would simplify :
A * (1 - uitofp i1 C) + B * uitofp i1 C 
down to :
select C, B, A

In practice we found that the first two substitutions can have a negative effect on performance, because they reduce opportunities to use FMA contractions; between the two options FMAs are often the better choice.  This change list amends the previous one to enable just these inst combines:

select C, B, 0 + select C, 0, A —> select C, B, A
A * (1 - uitofp i1 C) + B * uitofp i1 C —> select C, B, A


Feedback appreciated,

JL


-------------- next part --------------
A non-text attachment was scrubbed...
Name: blendWithoutCompromisingFMA.patch
Type: application/octet-stream
Size: 5418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130521/bc292f5a/attachment.obj>


More information about the llvm-commits mailing list