[PATCH] D99908: [GlobalISel] Simplify G_ICMP against true/false when boolean contents are 0/1

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 09:51:31 PDT 2021


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3908
+  assert(MI.getOpcode() == TargetOpcode::G_ICMP);
+  if (!KB)
+    return false;
----------------
arsenm wrote:
> aemerson wrote:
> > paquette wrote:
> > > arsenm wrote:
> > > > Is this actually optional?
> > > AArch64PostLegalizerLowering doesn't have it, but maybe it should?
> > > 
> > > Or maybe I should make this an assert.
> > I don't see why it should be mandatory. Combines should just skip if it isn't available.
> I think this should be handled by marking a specific combine in tablegen as needing known bits. Every combine shouldn't have to insert its own check for this
That's fair enough, but until that support is implemented, we shouldn't just assert if an analysis is missing.


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

https://reviews.llvm.org/D99908



More information about the llvm-commits mailing list