Commit Graph

12 Commits

Author SHA1 Message Date
Craig Topper 0a7c2b2b16 [X86] Restrict vselect handling in scalarizeExtEltFP to only case to pre type legalization where the setcc result type is vXi1.
If the vector setcc has been legalized then we will need to convert a vector boolean of 0 or -1 to a scalar boolean of 0 or 1.

The added test case previously crashed in 32-bit mode by creating a setcc with an i64 condition that type legalization couldn't expand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358218 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 19:57:44 +00:00
Craig Topper b0ed82c8f9 [X86] Add 32-bit command line to extractelement-fp.ll so I can add a test case for a 32-bit only crasher. NFC
This is a bit ugly for ABI reasons about how floats/doubles are returned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358217 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 19:57:24 +00:00
Nirav Dave d3c5ebd041 [DAGCombine] Prune unnused nodes.
Summary:
Nodes that have no uses are eventually pruned when they are selected
from the worklist. Record nodes newly added to the worklist or DAG and
perform pruning after every combine attempt.

Reviewers: efriedma, RKSimon, craig.topper, spatel, jyknight

Reviewed By: jyknight

Subscribers: jdoerfert, jyknight, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357283 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 17:35:56 +00:00
Sanjay Patel b1c30dbc63 [x86] limit extractelement of setcc to pre-legalization
A fuzzer found the crasher:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13700

The bug was introduced recently here:
rL355741

This is the quick fix. If we need to do this transform
later, then we'd have to extend/truncate the vector setcc
element type to the scalar setcc type (i8). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-13 14:49:52 +00:00
Sanjay Patel 283655fcc3 [x86] scalarize extractelement 0 of FP vselect
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355955 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 19:20:45 +00:00
Sanjay Patel 6a6735dc58 [x86] add x86-specific opcodes to extractelement scalarization list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355792 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-10 18:56:21 +00:00
Sanjay Patel e7e3dde903 [x86] add tests for extract of FP select; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-09 02:11:05 +00:00
Sanjay Patel f033627be4 [x86] scalarize extract element 0 of FP cmp
An extension of D58282 noted in PR39665:
https://bugs.llvm.org/show_bug.cgi?id=39665

This doesn't answer the request to use movmsk, but that's an
independent problem. We need this and probably still need
scalarization of FP selects because we can't do that as a
target-independent transform (although it seems likely that
targets besides x86 should have this transform).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355741 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 21:54:41 +00:00
Sanjay Patel c00fa49767 [x86] add tests for extracted vector FP cmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355727 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08 20:45:27 +00:00
Sanjay Patel 81588cab8d [x86] add extract FP tests for target-specific nodes; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355655 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-07 23:55:54 +00:00
Sanjay Patel 014b2ad719 [x86] scalarize extract element 0 of FP math
This is another step towards ensuring that we produce the optimal code for reductions,
but there are other potential benefits as seen in the tests diffs:

  1. Memory loads may get scalarized resulting in more efficient code.
  2. Memory stores may get scalarized resulting in more efficient code.
  3. Complex ops like fdiv/sqrt get scalarized which may be faster instructions depending on uarch.
  4. Even simple ops like addss/subss/mulss/roundss may result in faster operation/less frequency throttling when scalarized depending on uarch.

The TODO comment suggests 1 or more follow-ups for opcodes that can currently result in regressions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355130 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 19:47:04 +00:00
Sanjay Patel aea63d5e2d [x86] add tests for extractelement of FP; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354077 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-14 23:17:22 +00:00