This is an archive of the discontinued LLVM Phabricator instance.

[DAG] add splat vector support for 'and' in SimplifyDemandedBits
ClosedPublic

Authored by spatel on Apr 19 2017, 8:53 AM.

Details

Summary

The patch itself is simple: stop discriminating against vectors in visitAnd() and again in SimplifyDemandedBits().

Some notes for reference:

  1. We're not consistent about calls to SimplifyDemandedBits in the various visitXXX functions. Sometimes, we check if the RHS is a constant first. Other times (like here), we just dive in.
  2. I'd like to break the vector shackles in steps for the sake of risk minimization, but we could make similar simultaneous changes in other places if we think that would be better.
  3. I don't know what the intent of the tests in this patch was supposed to be, but since they wiggled in a positive way, I'm just going with that. :)
  4. In the rotate tests, note that we can see through non-splat constants. This is a result of D24253.
  5. My motivation for being here now is to make D31944 look better, so this is step 1 of N towards improving the vector codegen in that patch without writing any actual new code.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Apr 19 2017, 8:53 AM
RKSimon accepted this revision.Apr 19 2017, 9:33 AM

LGTM

test/CodeGen/X86/vector-rotate-256.ll
1051 ↗(On Diff #95762)

Looks like we're missing a SimplifyDemandedBits for ISD::ROTL/ISD::ROTR - but that's a problem for another day.

This revision is now accepted and ready to land.Apr 19 2017, 9:33 AM
This revision was automatically updated to reflect the committed changes.