[llvm] [VPlan] Add VPIRInstruction, use for exit block live-outs. (PR #100735)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 14 04:38:50 PDT 2024


================
@@ -8695,17 +8698,18 @@ addUsersInExitBlock(VPlan &Plan,
   }
 
   // Introduce VPUsers modeling the exit values.
-  for (const auto &[ExitPhi, V] : ExitingValuesToFix) {
+  for (const auto &[IR, V] : ExitingValuesToFix) {
     // Pass live-in values used by exit phis directly through to the live-out.
----------------
fhahn wrote:

They are redundant, but I think there were some cases where it made it through the pipeline (there's a number of cases where various unsimplified constructs make it to LV), which caused adding https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/LoopVectorize/extract-from-end-vector-constant.ll#L35.

We could alternatively remove them after vectorization, but this cannot be done in VPlan, as the users of the exit phi are not modeled. Doing a separate cleanup outside of VPlan would also be an option, but less desirable than the current solution?

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


More information about the llvm-commits mailing list