[PATCH] D102969: [GlobalISel] Add G_SBFX/G_UBFX to computeKnownBits

Brendon Cahoon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 1 19:07:58 PDT 2021


bcahoon added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp:514
+        WidthKnown.getMinValue().getLimitedValue(BitWidth));
+    Known = KnownBits::lshr(SrcOpKnown, OffsetKnown) & Mask;
+    if (Opcode == TargetOpcode::G_SBFX) {
----------------
foad wrote:
> RKSimon wrote:
> > foad wrote:
> > > RKSimon wrote:
> > > > Are you going to have any issues here when Mask.hasConflict() is true?
> > > That can only happen if WidthKnown.getMinValue() > WidthKnown.getMaxValue(), which I guess can only happen if WidthKnown.hasConflict() was already true. What are the rules about introducing or propagating conflicts?
> > Well, we do assert there is no conflict at the end of GISelKnownBits::computeKnownBitsImpl so we should be ensuring this doesn't happen.
> Right, but I'm saying that this code can't produce a conflict out of thin air, only if one of the inputs already had a conflict, so I *think* it's OK. Would you agree?
I'm not sure what, if anything, needs to be done to handle a conflict here? Appreciate any suggestions.


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

https://reviews.llvm.org/D102969



More information about the llvm-commits mailing list