[PATCH] D76738: [llvm][IR][CastInst] Update `castIsValid` for scalable vectors.

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 16:20:22 PDT 2020


fpetrogalli updated this revision to Diff 253006.
fpetrogalli added a comment.

Hi @efriedma,

thank you for your review!

I have addressed all your comments, and applied the following changes:

1. restored the use of unsigned for the size in bits. I have created a

separate patch that updated the `unsigned Type::getScalarSizeInBits()`
to use `TypeSize::getFixedSize()`: https://reviews.llvm.org/D76892

2. I have fixed the tests that were refusing to bitcast fixed size

vectors to scalable vectors (and viceversa). In the previous patch I
erroneusly used scalable vectors everywhere, just with different
lanes.

3. I have replaced the use of `getVectorElementCount` with variables

that are set at the beginning of the method.

4. I have renamed `[Src|Dst]BitSize` to `[Src|Dst]ScalarBitSize`, to

avoid confusion when dealing with vector types instead of scalars.

Kind regards,

Francesco


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76738/new/

https://reviews.llvm.org/D76738

Files:
  llvm/lib/IR/Instructions.cpp
  llvm/unittests/IR/InstructionsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76738.253006.patch
Type: text/x-patch
Size: 11044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200326/a61e8f8b/attachment.bin>


More information about the llvm-commits mailing list