OSDN Git Service

[x86] increment/decrement constant vector with min/max in vsetcc lowering (PR39859)
authorSanjay Patel <spatel@rotateright.com>
Sun, 16 Dec 2018 15:05:48 +0000 (15:05 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 16 Dec 2018 15:05:48 +0000 (15:05 +0000)
commitd353a688c4eef5107be526e2dc2020b1d267c133
treee418b5c658ea5cc4c42dff47f9605b3807415930
parentc5f4a842fffd0877598f77c7e6db4ce8c7d717a7
[x86] increment/decrement constant vector with min/max in vsetcc lowering (PR39859)

This is part of fixing PR39859:
https://bugs.llvm.org/show_bug.cgi?id=39859

We have a crippled vector ISA, so we have to invert a typical fold and create min/max here.

As discussed in the bug report, we can probably do better by using saturating subtract when
it's available, but we should have this improvement for the min/max patterns regardless.

Alive proofs:
https://rise4fun.com/Alive/zsf
https://rise4fun.com/Alive/Qrl

Differential Revision: https://reviews.llvm.org/D55515

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349304 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/sat-add.ll
test/CodeGen/X86/vec_minmax_match.ll
test/CodeGen/X86/vec_setcc-2.ll