This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: fewerElementsVector for G_TRUNC
AbandonedPublic

Authored by arsenm on Jul 3 2019, 5:24 PM.

Details

Summary

Start defining AMDGPU legalize rules for G_TRUNC.

Diff Detail

Event Timeline

arsenm created this revision.Jul 3 2019, 5:24 PM
aemerson added inline comments.Jul 8 2019, 4:42 PM
test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-sext.mir
64

Test still worthwhile having given it's now just a scalar artifact combine?

arsenm marked an inline comment as done.Jul 8 2019, 4:49 PM
arsenm added inline comments.
test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-sext.mir
64

I'm not even sure this patch is the right way to go. I'm still not 100% sure how to get the artifacts into the end state I want while maintaining valid MIR at every step. I had to drop this patch and make all vector truncates legal to get my G_BUILD_VECTOR lowerings to not infinite loop. Declaring every vector truncate legal almost kind of works assuming every use is legalized, but fails in some degenerate cases (like an implicit use on a target instruction)

arsenm marked an inline comment as done.Jul 10 2019, 7:25 AM
arsenm added inline comments.
test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-sext.mir
64

I think D64436 avoids these issues, so scalarizing trunc should work

arsenm marked an inline comment as done.Jul 10 2019, 7:51 AM
arsenm added inline comments.
test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-sext.mir
64

Maybe not, I'm still seeing some of these loops in another one of my branches

arsenm abandoned this revision.Feb 18 2020, 6:54 AM

Posted newer, better version