[PATCH] D86393: [GISel] Add combines for unary FP instrs with constant operand
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 08:04:06 PDT 2020
arsenm added inline comments.
================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:295
+// Fold fneg(cst) to cst result of fneg operation
+def constant_fneg_matchinfo: GIDefMatchData<"Optional<APFloat>">;
+def constant_fneg: GICombineRule <
----------------
mkitzan wrote:
> paquette wrote:
> > Do you need separate `matchinfo` definitions?
> >
> > I've noticed all the combines do this, but I think it would be better to just say
> >
> > ```
> > def fconstant_matchinfo: GIDefMatchData<"Optional<APFloat>">;
> > ```
> >
> > and then reuse it in every combine that uses it versus redefining matchinfo for every combine. (The rest of the combines could probably be cleaned up similarly in a later commit if this works)
> When they are all refactored into a single combine rule, we'll end up with one `matchinfo` for free.
Tablegen isn't smart enough to reuse identical matchinfos (although this should really be fixed)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86393/new/
https://reviews.llvm.org/D86393
More information about the llvm-commits
mailing list