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

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 14:42:05 PST 2021


paquette added inline comments.


================
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
+
----------------
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.


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

https://reviews.llvm.org/D96913



More information about the llvm-commits mailing list