This patch adds VPValue version of the GEP's operands to
VPWidenGEPRecipe and uses them during code-generation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I initially thought it might make things easier to do base ptr/indices separately, but it turned out handling the base ptr in the patch as well was not much extra work. Updated!
We still use GEP->clone() for the case where the GEP is loop invariant. It would probably be best to do that in a follow-on patch. Same for perhaps storing InBounds directly in the recipe as well.
Right, clone() should be replaced by generating the GEP from scratch as done in the non-invariant case. Also, now that we have VPOperands it would be better to expose an VPValue::isInvariant() / VPlan::isInvariant(VPValue &) API instead of recording that datum in WidenGEP & WidenSelect recipes, facilitating RAUW. Such API could initially query the underlying IR.
Other properties already captured by an underlying value such as inBounds and nsw are probably worth a separate discussion.
All these can indeed be follow-ups.