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
Unit Tests
Time | Test | |
---|---|---|
260 ms | windows > lld.ELF/invalid::symtab-sh-info.s |
Event Timeline
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
7460 | SmallestEltTy.getScalarSizeInBits() | |
7462 | SmallestEltTy.getScalarSizeInBits() | |
7478 | EltVT.getScalarSizeInBits() | |
7548 | SrcEltTy.getScalarSizeInBits() / SmallestEltTy.getScalarSizeInBits() | |
8322 | ScalarVT.getScalarSizeInBits | |
10105 | 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()