This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add vector shift by immediate to SimplifyDemandedBitsForTargetNode.
ClosedPublic

Authored by craig.topper on Nov 2 2018, 11:18 PM.

Details

Summary

This also enables some constant folding from KnownBits propagation. This helps on some cases vXi64 case in 32-bit mode where constant vectors appear as vXi32 and a bitcast. This can prevent getNode from constant folding sra/shl/srl.

Diff Detail

Event Timeline

craig.topper created this revision.Nov 2 2018, 11:18 PM
spatel accepted this revision.Nov 4 2018, 8:20 AM

LGTM

lib/Target/X86/X86ISelLowering.cpp
31857–31859

This could use a comment like the generic SRA:

// If any of the demanded bits are produced by the sign extension, we also
// demand the input sign bit.
This revision is now accepted and ready to land.Nov 4 2018, 8:20 AM
This revision was automatically updated to reflect the committed changes.