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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 14:24:49 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3908
+  assert(MI.getOpcode() == TargetOpcode::G_ICMP);
+  if (!KB)
+    return false;
----------------
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


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

https://reviews.llvm.org/D99908



More information about the llvm-commits mailing list