]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bpf: enable instruction scheduling
authorJose E. Marchesi <jose.marchesi@oracle.com>
Fri, 14 Jul 2023 11:54:06 +0000 (13:54 +0200)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Fri, 14 Jul 2023 12:17:38 +0000 (14:17 +0200)
This patch adds a dummy FSM to bpf.md in order to get INSN_SCHEDULING
defined.  If the later is not defined, the `combine' pass generates
paradoxical subregs of mems, which seems to then be mishandled by LRA,
resulting in invalid code.

Tested in bpf-unknown-none.

gcc/ChangeLog:

2023-07-14  Jose E. Marchesi  <jose.marchesi@oracle.com>

PR target/110657
* config/bpf/bpf.md: Enable instruction scheduling.

gcc/config/bpf/bpf.md

index f6be0a2123451289ddced0d9f37b5feaa916e2d7..329f62f55c336f50f2c2faa53d2c229fda369b0a 100644 (file)
 (include "predicates.md")
 (include "constraints.md")
 
+;;;; Instruction Scheduler FSM
+
+;; This is just to get INSN_SCHEDULING defined, so that combine does
+;; not make paradoxical subregs of memory.  These subregs seems to
+;; confuse LRA that ends generating wrong instructions.
+
+(define_automaton "frob")
+(define_cpu_unit "frob_unit" "frob")
+(define_insn_reservation "frobnicator" 814
+  (const_int 0) "frob_unit")
+
 ;;;; Unspecs
 
 (define_c_enum "unspec" [