[PATCH] D76738: [llvm][IR][CastInst] Update `castIsValid` for scalable vectors.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 26 16:52:48 PDT 2020
efriedma added inline comments.
================
Comment at: llvm/lib/IR/Instructions.cpp:3282
case Instruction::PtrToInt:
- if (isa<VectorType>(SrcTy) != isa<VectorType>(DstTy))
+ if (SrcIsVec != DstIsVec)
+ return false;
----------------
"if (SrcIsVec != DstIsVec)" is redundant, here and for IntToPtr.
================
Comment at: llvm/lib/IR/Instructions.cpp:3333
- if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) {
- if (VectorType *DstVecTy = dyn_cast<VectorType>(DstTy))
- return (SrcVecTy->getNumElements() == DstVecTy->getNumElements());
+ if (SrcIsVec) {
+ if (DstIsVec)
----------------
Remove "if (SrcIsVec)", and just do "return SrcEC == DstEC;"?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76738/new/
https://reviews.llvm.org/D76738
More information about the llvm-commits
mailing list