Page MenuHomePhabricator

AMDGPU: Add simple machine level computeKnownBits

Authored by arsenm on Feb 28 2017, 10:59 AM.



The DAG makes it difficult/impossible to make the right
decisions when there are no direct equivalents between SALU
and VALU instructions.

For example, we can use the v_cvt_pk_u16_u32 instruction to
pack a v2i16 if the known high bits are 0. However there is no
scalar equivalent, so pattern matching this in the DAG
introduces divergences from what would be a simple bit pattern.
With known bits, we can pattern match this after it is known
to really be a vector op.

This also may be useful for the SDWA pass.

Diff Detail

Event Timeline

arsenm created this revision.Feb 28 2017, 10:59 AM
arsenm updated this revision to Diff 90082.Feb 28 2017, 2:04 PM

Fix shift mask computation

tstellar accepted this revision.Mar 1 2017, 8:56 AM
tstellar added a subscriber: tstellar.

We'll need something like this for GlobalISel anyway.

This revision is now accepted and ready to land.Mar 1 2017, 8:56 AM
t-tye added a subscriber: t-tye.Mar 22 2017, 6:40 PM
tony-tye removed a subscriber: tony-tye.Mar 22 2017, 6:47 PM