diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2023-05-04 20:26:12 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2023-05-04 20:27:05 +0200 |
commit | 8cac23781753bd8a016507dc9b21ec563e1d9b49 (patch) | |
tree | e8bcdf04858f7e309f33a82184a12b525028ae96 | |
parent | ac7c9954ece9a75c5e7c3b76a4800f2432002487 (diff) | |
download | gcc-8cac23781753bd8a016507dc9b21ec563e1d9b49.zip gcc-8cac23781753bd8a016507dc9b21ec563e1d9b49.tar.gz gcc-8cac23781753bd8a016507dc9b21ec563e1d9b49.tar.bz2 |
i386: Tighten ashift to lea splitter operand predicates [PR109733]
The predicates of ashift to lea post-reload splitter were too broad
so the splitter tried to convert the mask shift instruction. Tighten
operand predicates to match only general registers.
gcc/ChangeLog:
PR target/109733
* config/i386/predicates.md (index_reg_operand): New predicate.
* config/i386/i386.md (ashift to lea spliter): Use
general_reg_operand and index_reg_operand predicates.
-rw-r--r-- | gcc/config/i386/i386.md | 8 | ||||
-rw-r--r-- | gcc/config/i386/predicates.md | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index d49f1cd..63207fc 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -13331,8 +13331,8 @@ ;; Convert ashift to the lea pattern to avoid flags dependency. (define_split - [(set (match_operand:SWI 0 "register_operand") - (ashift:SWI (match_operand:SWI 1 "index_register_operand") + [(set (match_operand:SWI 0 "general_reg_operand") + (ashift:SWI (match_operand:SWI 1 "index_reg_operand") (match_operand 2 "const_0_to_3_operand"))) (clobber (reg:CC FLAGS_REG))] "reload_completed @@ -13350,9 +13350,9 @@ ;; Convert ashift to the lea pattern to avoid flags dependency. (define_split - [(set (match_operand:DI 0 "register_operand") + [(set (match_operand:DI 0 "general_reg_operand") (zero_extend:DI - (ashift:SI (match_operand:SI 1 "index_register_operand") + (ashift:SI (match_operand:SI 1 "index_reg_operand") (match_operand 2 "const_0_to_3_operand")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 878b144..362266e 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -32,6 +32,11 @@ (and (match_code "reg") (match_test "GENERAL_REGNO_P (REGNO (op))"))) +;; True if the operand is an INDEX class register. +(define_predicate "index_reg_operand" + (and (match_code "reg") + (match_test "INDEX_REGNO_P (REGNO (op))"))) + ;; True if the operand is a nonimmediate operand with GENERAL class register. (define_predicate "nonimmediate_gr_operand" (if_then_else (match_code "reg") |