[PATCH] D89116: [SVE][AArch64] Replace TypeSize comparisons with their integer equivalents
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 08:35:42 PDT 2020
sdesmalen added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7460
unsigned ResMultiplier =
- VT.getScalarSizeInBits() / SmallestEltTy.getSizeInBits();
- NumElts = VT.getSizeInBits() / SmallestEltTy.getSizeInBits();
+ VT.getScalarSizeInBits() / SmallestEltTy.getFixedSizeInBits();
+ uint64_t VTSize = VT.getFixedSizeInBits();
----------------
`SmallestEltTy.getScalarSizeInBits()`
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7462
+ uint64_t VTSize = VT.getFixedSizeInBits();
+ NumElts = VTSize / SmallestEltTy.getFixedSizeInBits();
EVT ShuffleVT = EVT::getVectorVT(*DAG.getContext(), SmallestEltTy, NumElts);
----------------
`SmallestEltTy.getScalarSizeInBits()`
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7478
EVT EltVT = SrcVT.getVectorElementType();
- unsigned NumSrcElts = VT.getSizeInBits() / EltVT.getSizeInBits();
+ unsigned NumSrcElts = VTSize / EltVT.getFixedSizeInBits();
EVT DestVT = EVT::getVectorVT(*DAG.getContext(), EltVT, NumSrcElts);
----------------
`EltVT.getScalarSizeInBits()`
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7548
+ Src.WindowScale =
+ SrcEltTy.getFixedSizeInBits() / SmallestEltTy.getFixedSizeInBits();
Src.WindowBase *= Src.WindowScale;
----------------
`SrcEltTy.getScalarSizeInBits() / SmallestEltTy.getScalarSizeInBits()`
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:8322
- if (ScalarVT.getSizeInBits() < 32 && ScalarVT.isInteger())
+ if (ScalarVT.getFixedSizeInBits() < 32 && ScalarVT.isInteger())
ScalarVT = MVT::i32;
----------------
`ScalarVT.getScalarSizeInBits`
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:10105
return false;
- unsigned NumBits1 = Ty1->getPrimitiveSizeInBits();
- unsigned NumBits2 = Ty2->getPrimitiveSizeInBits();
+ uint64_t NumBits1 = Ty1->getPrimitiveSizeInBits().getFixedSize();
+ uint64_t NumBits2 = Ty2->getPrimitiveSizeInBits().getFixedSize();
----------------
Are you sure this shouldn't also work for vectors?
If not, then it's better to use `Ty1->getScalarSizeInBits()`
================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:458
// the default cost for the extend.
- if (DstVT.getSizeInBits() < SrcVT.getSizeInBits())
+ if (DstVT.getFixedSizeInBits() < SrcVT.getFixedSizeInBits())
return Cost + getCastInstrCost(Opcode, Dst, Src, TTI::CastContextHint::None,
----------------
`DstVT.getScalarSizeInBits() < SrcVT.getScalarSizeInBits()`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89116/new/
https://reviews.llvm.org/D89116
More information about the llvm-commits
mailing list