[llvm] [instcombine] Scalarize operands of vector geps if possible (PR #145402)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 08:46:36 PDT 2025


================
@@ -2983,6 +2983,7 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
   // For vector geps, use the generic demanded vector support.
   // Skip if GEP return type is scalable. The number of elements is unknown at
   // compile-time.
+  // TODO: exploit undef elements to decrease demanded bits
----------------
preames wrote:

I was simply moving the comment.  I think it refers to using undef elements of one index to reason that the same elements of another index are undemanded since the result for that lane must be undefined.  (Hm, having written that, undef seems slightly questionable, but it should apply for poison)

https://github.com/llvm/llvm-project/pull/145402


More information about the llvm-commits mailing list