[PATCH] D23337: [x86, AVX] allow FP vector select folding to bitwise logic ops (PR28895)

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 09:32:57 PDT 2016


andreadb added a comment.

In https://reviews.llvm.org/D23337#511223, @spatel wrote:

> In https://reviews.llvm.org/D23337#510940, @andreadb wrote:
>
> > Could you please also add extra test cased with ordered comparisons? I am only seeing tests for unordered comparisons in 'select-with-and-or.ll'.
>
>
> Good point - I lazily copied the existing tests here but only changed the select operands to FP types. I changed the tests to use varying predicates in:
>  https://reviews.llvm.org/rL278229
>
> Let me know if you see any holes in the coverage - fun mental exercise of translating LLVM predicates to SSE predicates... :)
>  If there is a bug in that part, it should be independent of this patch.


Hi Sanjay,

The test coverage seems OK.
If you really want to increase the test coverage, then you could probably add a test for `fcmp ole`.

Something like this:

;;;;
define <4 x float> @test_ole(<4 x float> %A, <4 x float> %B, <4 x float> %C) {
entry:

  %0 = fcmp ole <4 x float> %A, %B
  %1 = select <4 x i1> %0, <4 x float> %C, <4 x float> zeroinitializer
  ret <4 x float> %1

}
;;;;

That said, your patch does the right thing.
For the example above, I verified that the compiler now generates a vcmpleps + vandps.

So, the patch lgtm. Thanks!


https://reviews.llvm.org/D23337





More information about the llvm-commits mailing list