[PATCH] D112300: [InstCombine] Don't split up Loads and free Exts

Andre Vieira via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 22 02:27:50 PDT 2021


avieira created this revision.
avieira added reviewers: SjoerdMeijer, adriantong1024, dmgreen, spatel.
Herald added subscribers: hiraditya, kristof.beyls.
avieira requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Hi,

This is a different approach to what I was trying to achieve with D111237 <https://reviews.llvm.org/D111237>. When testing the former patch I found that it was becoming increasingly difficult to undo the splitting of the Loads and Exts that InstCombine was doing. So I decided to instead prevent the sinking of the Exts when it didn't make sense to.

I added some AArch64 and Arm tests, since those were the ones I knew for sure this would affect, but it might also affect other targets with widening loads.

Benchmarked Spec2017Intrate and saw no signficant differences in either size or performance, it does however improve codegen in Snappy where for AArch64 a workaround was required to avoid a superfluous 'ands' (ZExt), removing that work-around shows a performance degradation that this patch recovers.

Would welcome some help benchmarking this!


https://reviews.llvm.org/D112300

Files:
  llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
  llvm/test/Transforms/InstCombine/AArch64/load_extend0.ll
  llvm/test/Transforms/InstCombine/ARM/load_ext_combine.ll
  llvm/test/Transforms/InstCombine/ARM/mve_ext_mask_loads.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112300.381491.patch
Type: text/x-patch
Size: 15831 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211022/5c89e2f7/attachment.bin>


More information about the llvm-commits mailing list