[PATCH] D96913: [AArch64][GlobalISel] Run redundant_sext_inreg in the post-legalizer combiner

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 16:51:04 PST 2021


aemerson accepted this revision.
aemerson added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/combine-sext-trunc-sextload.mir:2
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
-# RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
+# RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner --aarch64postlegalizercombinerhelper-only-enable-rule="sext_trunc_sextload" -verify-machineinstrs %s -o - | FileCheck %s
+
----------------
paquette wrote:
> aemerson wrote:
> > What happens if we don't restrict the combiner to this?
> test_combine_sext_of_sextload_not_matching ends up getting combined.
> 
> computeNumSignBits should give us 17 for the G_SEXTLOAD in that test. That's less than 24, so the G_SEXT_INREG ends up being eliminated.
That test is a bit redundant, I think it's fine to show the G_SEXT_INREG being combined away.


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

https://reviews.llvm.org/D96913



More information about the llvm-commits mailing list