[PATCH] D76640: [GlobalISel] Combine (x - 0) -> x
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 23 16:54:04 PDT 2020
paquette marked 2 inline comments as done.
paquette added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h:222
+ /// \p C.
+ bool matchConstantOp(const MachineOperand &MOP, int64_t C);
+
----------------
aemerson wrote:
> arsenm wrote:
> > The people on your twitter poll are insane and MO is the clearly dominant abbreviation
> Yes, this is terrible. And for that reason, I'm out.
58.93 twitter users agree that MOP is the morally superior abbreviation
================
Comment at: llvm/include/llvm/Target/GlobalISel/Combine.td:198
+ (defs root:$root),
+ (match (wip_match_opcode G_SUB):$root,
+ [{ return Helper.matchConstantOp(${root}->getOperand(2), 0); }]),
----------------
arsenm wrote:
> Why not also handle add at the same time?
Sure. It didn't show up too often, but I'll add it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76640/new/
https://reviews.llvm.org/D76640
More information about the llvm-commits
mailing list