[llvm-commits] Patch: Floating point optimizations for SimplifyInstruction

Michael Ilseman milseman at apple.com
Mon Dec 10 15:57:21 PST 2012


Ok, here's a new slew of revised patches:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-FIXMEs-surrounding-Constant-Data-Vectors-inst.patch
Type: application/octet-stream
Size: 3377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121210/ad81ade2/attachment.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Pattern-matchers-for-floating-point-values.patch
Type: application/octet-stream
Size: 3646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121210/ad81ade2/attachment-0001.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Added-a-slew-of-SimplifyInstruction-floating-point-o.patch
Type: application/octet-stream
Size: 11164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121210/ad81ade2/attachment-0002.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Remove-redunant-optimizations-from-InstCombine-inste.patch
Type: application/octet-stream
Size: 4155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121210/ad81ade2/attachment-0003.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Have-SimplifyBinOp-call-the-new-FAdd-FSub-FMul-helpe.patch
Type: application/octet-stream
Size: 1561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121210/ad81ade2/attachment-0004.obj>
-------------- next part --------------


On Dec 9, 2012, at 12:53 AM, Duncan Sands <baldrick at free.fr> wrote:

> Hi Michael,
> 
> >>> Let's enumerate the outcomes, where e.g. the (o, i) pattern means the sign of the outer and inner zero constants. The resulting sign should be the same as x's for the transformation to be valid:
>>>> x | (o, i) | Result
>>>> + | (+, +) | +
>>>> - | (+, +) | +    <--- bad!
>>>> + | (+, -) | +
>>>> - | (+, -) | +    <--- bad!
>>>> + | (-, +) | -    <--- bad!
>>>> - | (-, +) | -
>>>> + | (-, -) | +
>>>> - | (-, -) | -
>>>> 
>>>> So, from this it seems that the below is the correct pattern:
>>>>   fsub(anyZero, fsub(negZero, X)) ==> X
>>> 
>>> Does GCC do the transform in exactly these cases too?
>>> 
>> 
>> No idea. I can look into it, but I don't have any experience with GCC.
> 
> I can try to write a C testcase and see what the GCC optimizers do with it.
> 
> Ciao, Duncan.
> 



More information about the llvm-commits mailing list