diff options
author | Fraser Cormack <fraser@codeplay.com> | 2021-05-27 13:45:23 +0100 |
---|---|---|
committer | Fraser Cormack <fraser@codeplay.com> | 2021-06-04 09:53:15 +0100 |
commit | aec9cbbeb863dbd3ea362f99eb8b84dfbdb568a2 (patch) | |
tree | aaf45d25df3c9760f15e366c439b5325fd0447c2 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 67b1c37d9fd1283d7015edb9c0fecb24362751f4 (diff) | |
download | llvm-aec9cbbeb863dbd3ea362f99eb8b84dfbdb568a2.zip llvm-aec9cbbeb863dbd3ea362f99eb8b84dfbdb568a2.tar.gz llvm-aec9cbbeb863dbd3ea362f99eb8b84dfbdb568a2.tar.bz2 |
[SelectionDAG] Extend FoldConstantVectorArithmetic to SPLAT_VECTOR
This patch extends the SelectionDAG's ability to constant-fold vector
arithmetic to include support for SPLAT_VECTOR. This is not only for
scalable-vector types but also for fixed-length vector types, which
helps Hexagon in a couple of cases.
The original RISC-V test case was in fact an infinite DAGCombine loop.
The pattern `and (truncate v1), (truncate v2)` can be combined to
`truncate (and v1, v2)` but the truncate can similarly be combined back
to `truncate (and v1, v2)` (but, crucially, only when one of `v1` or
`v2` is a constant vector).
It wasn't exposed in on fixed-length types because a TRUNCATE of a
constant BUILD_VECTOR was folded into the BUILD_VECTOR itself, whereas
this did not happen for the equivalent (scalable-vector) SPLAT_VECTOR.
Reviewed By: RKSimon, craig.topper
Differential Revision: https://reviews.llvm.org/D103246
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions