This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Handle G_BUILD_VECTOR in isKnownToBeAPowerOfTwo
ClosedPublic

Authored by arsenm on Jan 6 2021, 4:28 PM.

Diff Detail

Event Timeline

arsenm created this revision.Jan 6 2021, 4:28 PM
arsenm requested review of this revision.Jan 6 2021, 4:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2021, 4:28 PM
Herald added a subscriber: wdng. · View Herald Transcript

Is this going to be used anywhere?

arsenm updated this revision to Diff 315239.Jan 7 2021, 2:06 PM

Fix missing half of patch

aemerson added inline comments.Jan 7 2021, 3:30 PM
llvm/lib/CodeGen/GlobalISel/Utils.cpp
655

What does it mean for a build_vector to be a known power of 2? Each element is *any* power of 2, or the vector is a splat of a power of 2?

arsenm added inline comments.Jan 7 2021, 3:41 PM
llvm/lib/CodeGen/GlobalISel/Utils.cpp
655

All are any power of 2 regardless of the individual values

aemerson accepted this revision.Jan 7 2021, 4:58 PM
This revision is now accepted and ready to land.Jan 7 2021, 4:58 PM
arsenm planned changes to this revision.Jan 12 2021, 1:11 PM
arsenm added inline comments.
llvm/lib/CodeGen/GlobalISel/Utils.cpp
655

I looked again at the DAG version, and it only considers constants. I'm thinking G_BUILD_VECTOR_TRUNC may not be correct in cases where the power of 2 bit is discarded

arsenm updated this revision to Diff 332161.Mar 21 2021, 8:26 AM

Only handle constants for G_BUILD_VECTOR_TRUNC

This revision is now accepted and ready to land.Mar 21 2021, 8:26 AM
arsenm requested review of this revision.Mar 21 2021, 8:27 AM
foad accepted this revision.Mar 22 2021, 5:24 AM
foad added a subscriber: foad.

LGTM.

llvm/lib/CodeGen/GlobalISel/Utils.cpp
676

Remove this comment.

This revision is now accepted and ready to land.Mar 22 2021, 5:24 AM