Phi nodes in non-header blocks are converted to select instructions after if-conversion. This patch updates the cost model to account for the selects.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM
lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
7280 ↗ | (On Diff #94742) | We don't need to handle Phi->getNumIncomingValues() == 0 - it doesn't pass the verifier, right? |
7285 ↗ | (On Diff #94742) | This returns 1 by default, right? I'm not entirely sure that's the right thing to do here, but it's probably no worse than the current state. |
test/Transforms/LoopVectorize/phi-cost.ll | ||
7 ↗ | (On Diff #94742) | Please also add a CHECK for the induction phi. |
Comment Actions
Thanks, Michael!
lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
7280 ↗ | (On Diff #94742) | That's right. |
7285 ↗ | (On Diff #94742) | Yes, it returns 1. We went with getCFInstrCost(Instrunction::PHI) when doing the inserts for predicated instructions, so I thought it would be good to be consistent. |
test/Transforms/LoopVectorize/phi-cost.ll | ||
7 ↗ | (On Diff #94742) | Will do. |