Added function BoUpSLP::getCost() to calculate the scalar or vector
cost of the specified list of instructions (expected scalar
instructions) or vector - scalar cost estimation.
Details
- Reviewers
mzolotukhin mkuper
Diff Detail
- Build Status
Buildable 4568 Build 4568: arc lint + arc unit
Event Timeline
| lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
|---|---|---|
| 420 | This seems like a weird interface, for a couple of reasons:
Splitting out a function that takes the vector and scalar type, and returns the difference, instead of having the subtraction repeated in every case, doesn't sound like a bad idea. Can you explain why this is an improvement over that, though? | |
| 1847–1848 | Isn't the point of getCostOrDiff that you should be able to pass the vector and the scalar types, and get the difference? Why are you using two calls and then subtracting? | |
| 4895 | This looks unrelated. | |
This makes sense. Some minor comments inline.
| lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
|---|---|---|
| 420 | This still doesn't explain under what conditions it makes sense to return a None cost. | |
| 1850 | Any reason the shuffle case can't live with the rest in getCost()? | |
| 1884 | Why not put the llvm_unreachable here? I think it'd be clearer. | |
This seems like a weird interface, for a couple of reasons:
Splitting out a function that takes the vector and scalar type, and returns the difference, instead of having the subtraction repeated in every case, doesn't sound like a bad idea. Can you explain why this is an improvement over that, though?