[llvm] [VPlan] Introduce vputils::mustReplicate (NFC) (PR #199047)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 05:14:55 PDT 2026


================
@@ -626,8 +626,9 @@ unsigned VPInstruction::getNumOperandsForOpcode() const {
   llvm_unreachable("all cases should be handled above");
 }
 
-bool VPInstruction::doesGeneratePerAllLanes() const {
-  return Opcode == VPInstruction::PtrAdd && !vputils::onlyFirstLaneUsed(this);
+bool VPInstruction::mustReplicate() const {
+  return Opcode == VPInstruction::Unpack ||
----------------
david-arm wrote:

To be honest, I'm a bit sceptical that this is really NFC, although no tests have changed. That's because `materializePacksAndUnpacks` wasn't checking for `VPInstruction::Unpack`, whereas `replicateByVF` was. By introducing the same function `mustReplicate` in both callsites we're extending the functionality of `materializePacksAndUnpacks`.

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


More information about the llvm-commits mailing list