[PATCH] D77691: [SVE] Remove calls to isScalable from IR
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 22 09:12:50 PDT 2020
ctetreau marked 2 inline comments as done.
ctetreau added inline comments.
================
Comment at: llvm/include/llvm/IR/PatternMatch.h:2176
Type *PtrTy = cast<Operator>(V)->getOperand(0)->getType();
- auto *DerefTy = dyn_cast<VectorType>(PtrTy->getPointerElementType());
- if (DerefTy && DerefTy->isScalable() &&
- DL.getTypeAllocSizeInBits(DerefTy).getKnownMinSize() == 8)
+ auto *DerefTy =
+ dyn_cast<ScalableVectorType>(PtrTy->getPointerElementType());
----------------
sdesmalen wrote:
> nit: now that we can use `isa<ScalableVectorType>`, it's probably better to write this as:
>
> ```
> auto *DerefTy = PtrTy->getPointerElementType();
> if (isa<ScalableVectorType>(DerefTy) &&
> DL.getTypeAllocSizeInBits(DerefTy).getKnownMinSize() == 8)```
will do
================
Comment at: llvm/unittests/IR/VectorTypesTest.cpp:179
EXPECT_EQ(V2I32Len.getKnownMinSize(), 64U);
- EXPECT_FALSE(V2I32Len.isScalable());
+ EXPECT_TRUE(V2I32Len.isScalable());
----------------
sdesmalen wrote:
> Shouldn't this be `EXPECT_FALSE`?
yes, not sure what happened here...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77691/new/
https://reviews.llvm.org/D77691
More information about the llvm-commits
mailing list