[PATCH] D94204: GlobalISel: Handle G_BUILD_VECTOR in isKnownToBeAPowerOfTwo

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 13:11:52 PST 2021


arsenm planned changes to this revision.
arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:596
+    for (unsigned I = 1, E = MI.getNumOperands(); I != E; ++I) {
+      if (!isKnownToBeAPowerOfTwo(MI.getOperand(I).getReg(), MRI, KB))
+        return false;
----------------
arsenm wrote:
> aemerson wrote:
> > What does it mean for a build_vector to be a known power of 2? Each element is *any* power of 2, or the vector is a splat of a power of 2?
> All are any power of 2 regardless of the individual values
I looked again at the DAG version, and it only considers constants. I'm thinking G_BUILD_VECTOR_TRUNC may not be correct in cases where the power of 2 bit is discarded


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

https://reviews.llvm.org/D94204



More information about the llvm-commits mailing list