In many places in the AArch64 backend we are comparing TypeSize objects,
but in fact we are only ever expecting fixed width types. I've changed
all such comparisons to use their integer equivalents by replacing
calls to getSizeInBits() with getFixedSizeInBits(), etc.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
7489–7491 | SmallestEltTy.getScalarSizeInBits() | |
7491 | SmallestEltTy.getScalarSizeInBits() | |
7507 | EltVT.getScalarSizeInBits() | |
7577 | SrcEltTy.getScalarSizeInBits() / SmallestEltTy.getScalarSizeInBits() | |
8351 | ScalarVT.getScalarSizeInBits | |
10143–10144 | Are you sure this shouldn't also work for vectors? If not, then it's better to use Ty1->getScalarSizeInBits() | |
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp | ||
458 | DstVT.getScalarSizeInBits() < SrcVT.getScalarSizeInBits() |
Please ignore my comments about getScalarSizeInBits, I thought that interface would assert that the type is not a vector (which I thought would be an extra guard that it's okay to ask for the fixed-size).
Instead, it returns the element type if the type is a vector, so in that case I agree it's better to use getFixedSizeInBits().
Based on what we discussed in the SVE call yesterday, I'm happy with the uses of getFixedSizeInBits. LGTM!
SmallestEltTy.getScalarSizeInBits()