[PATCH] D94433: Do not emit non-power-of-2 alignment assume bundles (PR48713).

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 08:16:49 PDT 2021


jdoerfert resigned from this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

I'm fine with this approach. @lebedev.ri has some comments and then this should be ok to go.



================
Comment at: llvm/lib/IR/Verifier.cpp:4611-4619
         Assert(Call.getOperand(Elem.Begin + 1)->getType()->isIntegerTy(),
                "second argument should be an integer");
+	ConstantInt *Alignment = dyn_cast<ConstantInt>(Call.getOperand(Elem.Begin + 1));
+	if (Alignment)
+	  Assert(Alignment->getValue().isPowerOf2(),
+           "alignment must be a power of 2", Call);
         if (ArgCount == 3)
----------------
lebedev.ri wrote:
> @jdoerfert Should second/third arguments be a *constant* integers ?
> 
Right now, I think so. I'd be fine if we later allow non-constants but that is a different story.


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

https://reviews.llvm.org/D94433



More information about the llvm-commits mailing list