[SVE] Fix isLoadInvariantInLoop for scalable vectors
authorDavid Sherwood <david.sherwood@arm.com>
Mon, 7 Sep 2020 08:17:10 +0000 (09:17 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 15 Sep 2020 07:30:19 +0000 (08:30 +0100)
commit69cccb3189d6e0535ab78411a37cfcccf06a58a7
tree69675e812fc3ddab068b800b9fdb62a11ecc0e30
parent943b0c8bffc55eba4cebaaffc4bd33856e271e94
[SVE] Fix isLoadInvariantInLoop for scalable vectors

I've amended the isLoadInvariantInLoop function to bail out for
scalable vectors for now since the invariant.start intrinsic is only
ever generated by the clang frontend for thread locals or struct
and class constructors, neither of which support sizeless types.
In addition, the intrinsic itself does not currently support the
concept of a scaled size, which makes it impossible to compare
the sizes of different scalable objects, e.g. <vscale x 32 x i8>
and <vscale x 16 x i8>.

Added new tests here:

  Transforms/LICM/AArch64/sve-load-hoist.ll
  Transforms/LICM/hoisting.ll

Differential Revision: https://reviews.llvm.org/D87227
llvm/lib/IR/Verifier.cpp
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Transforms/LICM/AArch64/lit.local.cfg [new file with mode: 0644]
llvm/test/Transforms/LICM/AArch64/sve-load-hoist.ll [new file with mode: 0644]
llvm/test/Transforms/LICM/hoisting.ll