tree-optimization/114921 - _Float16 -> __bf16 isn't noop
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
fail
|
Testing failed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
The vectorizer handles a _Float16 to __bf16 conversion through
vectorizable_assignment, thinking it's a noop. The following
fixes this by making the same-size check stricter, requiring
the same vector component mode.
Bootstrap & regtest running on x86_64-unknown-linux-gnu. I couldn't
manage to produce a meaningful (runtime) testcase.
PR tree-optimization/114921
* tree-vect-stmts.cc (vectorizable_assignment): Require
same vector component modes for input and output.
---
gcc/tree-vect-stmts.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
@@ -5961,8 +5961,7 @@ vectorizable_assignment (vec_info *vinfo,
|| code == VIEW_CONVERT_EXPR)
&& (!vectype_in
|| maybe_ne (TYPE_VECTOR_SUBPARTS (vectype_in), nunits)
- || maybe_ne (GET_MODE_SIZE (TYPE_MODE (vectype)),
- GET_MODE_SIZE (TYPE_MODE (vectype_in)))))
+ || TYPE_MODE (vectype) != TYPE_MODE (vectype_in)))
return false;
if (VECTOR_BOOLEAN_TYPE_P (vectype) != VECTOR_BOOLEAN_TYPE_P (vectype_in))