This is an archive of the discontinued LLVM Phabricator instance.

[GISel] Handle G_TRUNC in `matchExtractVecEltBuildVec`
ClosedPublic

Authored by Pierre-vh on Oct 4 2022, 4:56 AM.

Details

Summary

Spotted some cases in D134354 where this was an issue.

Diff Detail

Event Timeline

Pierre-vh created this revision.Oct 4 2022, 4:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 4:56 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Pierre-vh requested review of this revision.Oct 4 2022, 4:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 4:56 AM
arsenm added inline comments.Oct 5 2022, 8:46 AM
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
3930–3931

I don't see why this legality check (or the one below for build_vector_trunc) are here. The equivalent DAG combine does not check for the legality, and you're not creating a new one in the apply

3937

getVRegDef should be adequate here

Pierre-vh updated this revision to Diff 465666.Oct 6 2022, 12:02 AM
Pierre-vh marked 2 inline comments as done.

getDefIgnoringCopies -> getVRegDef

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
3930–3931

@aemerson I see you implemented this one, is it okay to remove the legalizer checks?

aemerson added inline comments.Oct 6 2022, 12:11 AM
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
3930–3931

Sure, I don’t remember why it’s there either.

Pierre-vh updated this revision to Diff 465669.Oct 6 2022, 12:33 AM
Pierre-vh marked an inline comment as done.

Remove legalizer checks, simplify code

arsenm accepted this revision.Oct 6 2022, 8:31 AM
This revision is now accepted and ready to land.Oct 6 2022, 8:31 AM
This revision was automatically updated to reflect the committed changes.