[PATCH] D61787: [GlobalISel Legalizer] Improve artifact combiner

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 05:47:30 PDT 2019


Petar.Avramovic added a reviewer: paquette.
Petar.Avramovic added a comment.

@volkan Regarding D65894 <https://reviews.llvm.org/D65894>.
Here, artifacts that failed to combine are moved to RetryList and we retry to combine them. Once all of the MachineInstrs that define use operands of our artifact are processed (are not in any of the Observer Lists) we turn artifact into an instruction. This way we have more opportunities for combines. e.g. in `/test/AMDGPU/GlobalISel/legalize-unmerge-values.mir` , this patch catches G_MERGE/G_UNMERGE combine that D65894 <https://reviews.llvm.org/D65894> cannot catch because those two are declared legal.
As for the other test changes in D65894 <https://reviews.llvm.org/D65894>, all of them are essentially here.
I also tried `test/CodeGen/AArch64/GlobalISel/retry-artifact-combine.mir` and got similar output, but with one less copy instr.
there are differences in `test/CodeGen/AMDGPU/GlobalISel/legalize-{xor|and|or}.mir`
D65894 <https://reviews.llvm.org/D65894> managed to combine few more G_TRUNC + G_ANYEXT but in the end both patches crash on  `%0:_(<4 x s8>) = G_TRUNC %29:_(<4 x s32>),` because order of combine attempts is different this patch crashed before attempting to combine mentioned G_TRUNC + G_ANYEXT.
Please check if I missed something the this patch does not cover compared to D65894 <https://reviews.llvm.org/D65894>.

See D65199 <https://reviews.llvm.org/D65199> for more tests with output from -debug option.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61787/new/

https://reviews.llvm.org/D61787





More information about the llvm-commits mailing list