Skip to content
Snippets Groups Projects
Commit 06d3f313 authored by Pan Li's avatar Pan Li Committed by xuli
Browse files

Vect: Make sure the lhs type of .SAT_TRUNC has its mode precision [PR116202]


The .SAT_TRUNC vect pattern recog is valid when the lhs type has
its mode precision.  For example as below, QImode with 1 bit precision
like _Bool is invalid here.

g_12 = (long unsigned int) _2;
_13 = MIN_EXPR <g_12, 1>;
_3 = (_Bool) _13;

The above pattern cannot be recog as .SAT_TRUNC (g_12) because the dest
only has 1 bit precision with QImode mode.  Aka the type doesn't have
the mode precision.

The below tests are passed for this patch.
1. The rv64gcv fully regression tests.
2. The x86 bootstrap tests.
3. The x86 fully regression tests.

	PR target/116202

gcc/ChangeLog:

	* tree-vect-patterns.cc (vect_recog_sat_trunc_pattern): Add the
	type_has_mode_precision_p check for the lhs type.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/pr116202-run-1.c: New test.

Signed-off-by: default avatarPan Li <pan2.li@intel.com>
parent 1b5c57e5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment