[PATCH] D135146: [GISel] Add redundant bitcast folding combine

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 18:53:24 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:972-973
+  (defs root:$op, register_matchinfo:$matchinfo),
+  (match (wip_match_opcode G_BITCAST):$op,
+      [{ return Helper.matchBitcastBitcastFold(*${op}, ${matchinfo}); }]),
+  (apply [{ Helper.replaceSingleDefInstWithReg(*${op}, ${matchinfo}); }])>;
----------------
I think this one is actually possible with the real matcher. 
Can you try something like


```
match (BITCAST $dst, $src1), (BITCAST $src1, $src0))

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135146



More information about the llvm-commits mailing list