diff options
author | Fraser Cormack <fraser@codeplay.com> | 2021-05-31 18:31:55 +0100 |
---|---|---|
committer | Fraser Cormack <fraser@codeplay.com> | 2021-06-07 14:37:56 +0100 |
commit | fd3b556958a9deee7ced33ec18b38c030145160b (patch) | |
tree | 31f97b341f84efd75f609655f50772cc21d54f77 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | d12000ca55d1cc8bc07f75457e3b4efbcd8ff657 (diff) | |
download | llvm-fd3b556958a9deee7ced33ec18b38c030145160b.zip llvm-fd3b556958a9deee7ced33ec18b38c030145160b.tar.gz llvm-fd3b556958a9deee7ced33ec18b38c030145160b.tar.bz2 |
[Constants] Extend support for scalable-vector splats
This patch extends the various "isXXX" functions of the `Constant` class
to include scalable-vector splats.
In several "isXXX" functions, code that was separately inspecting
`ConstantVector` and `ConstantDataVector` was unified to use
`getSplatValue`, which already includes support for said splats.
In the varous "isNotXXX" functions, code was added to check whether the
scalar splat value -- if any -- satisfies the predicate.
An extra fix for `isNotMinSignedValue` was included, as it previously
crashed when passed a scalable-vector type because it unconditionally
cast to `FixedVectorType`
These changes address numerous missed optimizations, a compiler crash
mentioned above and -- perhaps most egregiously -- an infinite loop in
InstCombine due to the compiler breaking canonical form when it failed
to pick up on a splat in a select instruction.
Test cases have been added to cover as many of these functions as
possible, though existing coverage is slim; it doesn't appear that there
are any in-tree uses of `Constant::isNegativeZeroValue`, for example.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D103421
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions