Replaced getVectorNumElements() with getVectorElementCount(). Added operator overloads for class ElementCount. Fixes warning in several AArch64 unit tests.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | ||
---|---|---|
454 | Changing the assertions here is fine. | |
490 | There are significant functional implications here, related to the type breakdown stuff Sander is looking at... a v1i8 is actually one element, an nxv1i8 is not. This needs some real design discussion and testing. |
llvm/include/llvm/Support/TypeSize.h | ||
---|---|---|
53 ↗ | (On Diff #267311) | These operators are a little dubious; it's possible for both A<B and A>=B to be false, which goes against mathematical intuition. |
llvm/include/llvm/Support/TypeSize.h | ||
---|---|---|
53 ↗ | (On Diff #267311) | Thanks for the review. Strict weak ordering is implemented -- (A < B) and (A >=B) can both be false as long as (A > B) is true. Is there a case where scalable and unscalable widths would be compared? If so then I can remove the LHS and RHS scalable comparisons from the operator overloads. |
llvm/include/llvm/Support/TypeSize.h | ||
---|---|---|
53 ↗ | (On Diff #267311) | I think I'd prefer to just write out the operation in the users for now, until we have some practical experience with what patterns we end up using in practice. |
Removed ElementCount operator overloads and reverted getVectorElementCount() for case i8 -> <1 x i1>
@efriedma My weak ordering was wrong. The logic I posted above does not always hold. A > B and B < A can both be true if one is scalable and the other is not. Anyhow what you propose makes sense. I made the changes in the latest edit.
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | ||
---|---|---|
490 | I reverted this back to getVectorNumElements(), we can revisit this part in a later patch. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | ||
---|---|---|
467 | This has the same issues as the other check; it treats an nxv1i8 as having "one" element, and I'm not sure that's appropriate here. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | ||
---|---|---|
467 | I reverted this change as well. Thanks. |
Changing the assertions here is fine.