OSDN Git Service

[x86] try to keep FP casted+truncated+extracted vector element out of GPRs
authorSanjay Patel <spatel@rotateright.com>
Mon, 15 Jul 2019 18:17:23 +0000 (18:17 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 15 Jul 2019 18:17:23 +0000 (18:17 +0000)
commit9f714c58c4d4b5c999adf5008f8bdf3386d53fd8
treecfdca5800bb4fbdc8dedc9706dcc3fade085b6b1
parent445646bd2f3b2a0cde923c145675ce4634bd7083
[x86] try to keep FP casted+truncated+extracted vector element out of GPRs

inttofp (trunc (extelt X, 0)) --> inttofp (extelt (bitcast X), 0)

We have pseudo-vectorization of scalar int to FP casts, so this tries to
make that more likely by replacing a truncate with a bitcast. I didn't see
any test diffs starting from 'uitofp', so I left that as a TODO. We can't
only match the shorter trunc+extract pattern because there's an opposing
transform somewhere, so we infinite loop. Waiting to try this during
lowering is another possibility.

A motivating case is shown in PR39975 and included in the test diffs here:
https://bugs.llvm.org/show_bug.cgi?id=39975

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366098 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/known-bits-vector.ll
test/CodeGen/X86/known-signbits-vector.ll