[PATCH] D134380: [GlobalISel] Fix known bits for G_ASSERT_ALIGN.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 10:15:55 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp:475
   case TargetOpcode::G_ASSERT_ALIGN: {
-    int64_t LogOfAlign = MI.getOperand(2).getImm();
-    if (LogOfAlign == 0)
----------------
aemerson wrote:
> arsenm wrote:
> > aemerson wrote:
> > > arsenm wrote:
> > > > arsenm wrote:
> > > > > aemerson wrote:
> > > > > > arsenm wrote:
> > > > > > > I thought 0 would be rejected by the verifier. This shouldn’t have been produced 
> > > > > > Ok I'll look into adding a verifier check and removing this handling for 0.
> > > > > Actually this is a different change than I thought. The immediate was supposed to be directly interpreted as the log2 value. Somewhere must be producing it with the raw alignment instead of the correct log2 value
> > > > 0 should still be invalid though
> > > Why bother with encoding it as a bit mask when other places use the number of bytes?
> > It's not a bitmask it's a number of bits. The only use is here to set a number of bits
> Right ok but same point, why deviate from the semantics of "alignment" at other IR levels?
I guess it doesn't really matter but everywhere needs to be consistent. I thought a value you can directly use would be more convenient 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134380



More information about the llvm-commits mailing list