[llvm] [GISel] Convert zext nneg to sext if it is cheaper (PR #93842)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 09:29:41 PDT 2024


tschuett wrote:

Why is the DAG doing this transform in the builder and not in the combiner?

```
def nneg_sext : GICombineRule<
   (defs root:$root, build_fn_matchinfo:$matchinfo),
   (match (G_SEXT $root, $x, (MIFlags NonNeg)),
   [{ return Helper.matchNonNegSext(${root}, ${matchinfo}); }]),
   (apply [{ Helper.applyBuildFnMO(${root}, ${matchinfo}); }])>;
```

https://github.com/llvm/llvm-project/pull/93842


More information about the llvm-commits mailing list