https://bugs.llvm.org/show_bug.cgi?id=40391
Bug ID: 40391
Summary: [X86] Use ValueTracking to convert x86-specific vector
shifts to generics
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: llvm-...@redking.me.uk
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com
Depends on: 36319
InstCombine already converts x86 vectors shifts to generic shifts for constant
shift amount cases (simplifyX86varShift + simplifyX86immShift).
For non-constant cases, ValueTracking (MaskedValueIsZero etc.) should be able
to determine when the upper bits of the shift amounts are known to be zero and
convert to generic shifts:
https://godbolt.org/z/7uik05
Similarly, if we know that any of the upper bits are NOT zero then we should be
able to convert either to zero or ashr(V, numbits-1) to match the x86 shift
behaviour.
The avx2+ per-element shifts case should be pretty straightforward, but it
requires all elements to match.
The older sse2+ uniform-element shift case is trickier as we need to correctly
value track the bottom 64-bits of the shift amount (spread across multiple
elements), [Bug #36319] would help us with this.
Referenced Bugs:
https://bugs.llvm.org/show_bug.cgi?id=36319
[Bug 36319] [ValueTracking] Add DemandedElts support to
computeKnownBits/ComputeNumSignBits
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs