Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Vectorize/VectorCombine.cpp | ||
---|---|---|
276 | SrcTy must be a vector here: it's the result type of a shufflevector. |
llvm/lib/Transforms/Vectorize/VectorCombine.cpp | ||
---|---|---|
281–282 | Now that SrcTy is of type VectorType because of the cast<>, this assert can be removed. |
llvm/lib/Transforms/Vectorize/VectorCombine.cpp | ||
---|---|---|
281–282 | I agree and will fix it, but for the record: whenever this happens, I did it so that the assert message wouldn't change. It might be nice if cast() had an overload that took a message that was used for the assert, but that's a problem for another day. Something like: auto *t = cast<Foo>(bar, "This is guaranteed to be a Foo becasue it's the return value of a BarInst"); |
llvm/lib/Transforms/Vectorize/VectorCombine.cpp | ||
---|---|---|
281–282 | Obviously in this case, this assert will never fire. But at one point it was a dyn_cast. |
SrcTy must be a vector here: it's the result type of a shufflevector.