[all-commits] [llvm/llvm-project] 451626: [GlobalISel] Combine [s, z]ext of undef into 0 (#11...

Thorsten Schütt via All-commits all-commits at lists.llvm.org
Mon Dec 2 22:15:11 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45162635bf657eb0a6cdebc6398fada974981c64
      https://github.com/llvm/llvm-project/commit/45162635bf657eb0a6cdebc6398fada974981c64
  Author: Thorsten Schütt <schuett at gmail.com>
  Date:   2024-12-03 (Tue, 03 Dec 2024)

  Changed paths:
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/test/CodeGen/AArch64/GlobalISel/combine-cast.mir
    M llvm/test/CodeGen/AArch64/extract-vector-elt.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/combine-amdgpu-cvt-f32-ubyte.mir
    M llvm/test/CodeGen/AMDGPU/shrink-add-sub-constant.ll

  Log Message:
  -----------
  [GlobalISel] Combine [s,z]ext of undef into 0 (#117439)

Alternative for https://github.com/llvm/llvm-project/pull/113764

It builds on a minimalistic approach with the legality check in match
and a blind apply. The precise patterns are used for better compile-time
and modularity. It also moves the pattern check into combiner. While
unary_undef_to_zero and propagate_undef_any_op rely on custom C++ code
for pattern matching.

Is there a limit on the number of patterns?

G_ANYEXT of undef -> undef
G_SEXT of undef -> 0
G_ZEXT of undef -> 0

The combine is not a member of the post legalizer combiner for AArch64.

Test:
llvm/test/CodeGen/AArch64/GlobalISel/combine-cast.mir



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list