[PATCH] D74101: [BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering
Yonghong Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 10 20:37:36 PST 2020
yonghong-song added a comment.
Note that I cannot do
In isTruncateFree() do
return NumBits1 > NumBits2;
This will permit a type truncate operation e.g., from 64bit to 8bit. This will cause a llvm internal assertion later since llvm expects
it produces a backend supported legal subregister type , which is 32bit in this case. PowerPC has similar implementation
bool PPCTargetLowering::isTruncateFree(Type *Ty1, Type *Ty2) const {
if (!Ty1->isIntegerTy() || !Ty2->isIntegerTy())
return false;
unsigned NumBits1 = Ty1->getPrimitiveSizeInBits();
unsigned NumBits2 = Ty2->getPrimitiveSizeInBits();
return NumBits1 == 64 && NumBits2 == 32;
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74101/new/
https://reviews.llvm.org/D74101
More information about the llvm-commits
mailing list