[PATCH] fix for PR20354 - Miscompile of fabs due to vectorization

Chandler Carruth chandlerc at gmail.com
Mon Jul 28 13:06:12 PDT 2014


Pinging this vigorously as it is a miscompile fix that has gone without
review for a week... Adding more folks.


On Tue, Jul 22, 2014 at 3:07 PM, Sanjay Patel <spatel at rotateright.com>
wrote:

> Hi rengolin, chandlerc, nadav,
>
> In PR20354 ( http://llvm.org/bugs/show_bug.cgi?id=20354 ), we're
> miscompiling a vector fabs operation.
>
> This patch corrects that case and allows optimization of vector fabs ops
> via sign bit twiddling rather than using FP instructions. It also changes
> the logic in visitFNEG to allow vector fneg ops to be optimized in a
> similar way.
>
> The fabs and fneg cases are similar enough that we should probably
> refactor the code to reduce duplication, but I don't want to add that
> complication to this patch.
>
> This patch breaks an existing ARM testcase in
> test/CodeGen/ARM/2009-10-21-InvalidFNeg.ll. That test was expecting use of
> VFPU/NEON, but now we don't even need to touch the FPU. I think that's
> universally better for any ARM target?
>
> I've added testcases to the existing X86 tests for vec_fabs and vec_neg.
> Also added a FIXME to the existing tests in vec_fneg.ll because they don't
> have any checks.
>
> http://reviews.llvm.org/D4633
>
> Files:
>   lib/CodeGen/SelectionDAG/DAGCombiner.cpp
>   test/CodeGen/ARM/2009-10-21-InvalidFNeg.ll
>   test/CodeGen/X86/vec_fabs.ll
>   test/CodeGen/X86/vec_fneg.ll
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140728/6d36daac/attachment.html>


More information about the llvm-commits mailing list