[all-commits] [llvm/llvm-project] c63689: [GlobalISel] Combine: (G_*MULO x, 0) -> 0 + no car...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Thu Feb 3 14:24:34 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c636899dc1fad6ecd0a1846d531df72fc7e76e22
      https://github.com/llvm/llvm-project/commit/c636899dc1fad6ecd0a1846d531df72fc7e76e22
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2022-02-03 (Thu, 03 Feb 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/prelegalizer-combiner-mulo-zero.mir

  Log Message:
  -----------
  [GlobalISel] Combine: (G_*MULO x, 0) -> 0 + no carry out

Similar to the following combine in `DAGCombiner::visitMULO`:

```
  // fold (mulo x, 0) -> 0 + no carry out
  if (isNullOrNullSplat(N1))
    return CombineTo(N, DAG.getConstant(0, DL, VT),
                     DAG.getConstant(0, DL, CarryVT));
```

This fixes some generally poor codegen for `*mulo`:

https://godbolt.org/z/eTxYsvz8f

Differential Revision: https://reviews.llvm.org/D118635




More information about the All-commits mailing list