This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Add constant fold combine for zext/sext/anyext
ClosedPublic

Authored by arsenm on Aug 9 2023, 7:45 AM.

Details

Summary

Could use more work for vectors.

Diff Detail

Event Timeline

arsenm created this revision.Aug 9 2023, 7:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 7:45 AM
arsenm requested review of this revision.Aug 9 2023, 7:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 7:45 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Aug 9 2023, 7:47 AM
llvm/test/CodeGen/AArch64/GlobalISel/uaddo-8-16-bits.mir
27

update_mir_test_checks is just broken here

arsenm updated this revision to Diff 548623.Aug 9 2023, 7:49 AM

Work around update bug

Pierre-vh added inline comments.Aug 11 2023, 12:20 AM
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
641–645

nit: could remove the second comment and just put the decls right next to each other.

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

nit: put DstTy.getScalarSizeInBits() in a variable

llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-binop-same-val.mir
29

lost comments in this file

llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-bzero.mir
21

ditto

llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-trivial-arith.mir
29

ditto

arsenm updated this revision to Diff 549368.Aug 11 2023, 6:27 AM
arsenm marked 3 inline comments as done.
arsenm added inline comments.
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
641–645

I think doxygen only handles that when they have the same name, these are different

Pierre-vh accepted this revision.Aug 24 2023, 3:54 AM

LGTM but rebase & retest since MIR patterns landed, it should solve a regression we saw during review

This revision is now accepted and ready to land.Aug 24 2023, 3:54 AM