Commit 4a5a0497 by H.J. Lu Committed by H.J. Lu

Don't check ix86_indirect_branch_register for GOT operand

Since GOT_memory_operand and GOT32_symbol_operand are simple pattern
matches, don't check ix86_indirect_branch_register here.  If needed,
-mindirect-branch= will convert indirect branch via GOT slot to a call
and return thunk.

	* config/i386/constraints.md (Bs): Update
	ix86_indirect_branch_register check.  Don't check
	ix86_indirect_branch_register with GOT_memory_operand.
	(Bw): Likewise.
	* config/i386/predicates.md (GOT_memory_operand): Don't check
	ix86_indirect_branch_register here.
	(GOT32_symbol_operand): Likewise.

From-SVN: r256714
parent 5ca876c3
2018-01-15 H.J. Lu <hongjiu.lu@intel.com> 2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/constraints.md (Bs): Update
ix86_indirect_branch_register check. Don't check
ix86_indirect_branch_register with GOT_memory_operand.
(Bw): Likewise.
* config/i386/predicates.md (GOT_memory_operand): Don't check
ix86_indirect_branch_register here.
(GOT32_symbol_operand): Likewise.
2018-01-15 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/predicates.md (constant_call_address_operand): * config/i386/predicates.md (constant_call_address_operand):
Rewrite ix86_indirect_branch_register logic. Rewrite ix86_indirect_branch_register logic.
(sibcall_insn_operand): Likewise. (sibcall_insn_operand): Likewise.
......
...@@ -225,20 +225,18 @@ ...@@ -225,20 +225,18 @@
(define_constraint "Bs" (define_constraint "Bs"
"@internal Sibcall memory operand." "@internal Sibcall memory operand."
(ior (and (not (match_test "TARGET_X32 (ior (and (not (match_test "ix86_indirect_branch_register"))
|| ix86_indirect_branch_register")) (not (match_test "TARGET_X32"))
(match_operand 0 "sibcall_memory_operand")) (match_operand 0 "sibcall_memory_operand"))
(and (match_test "TARGET_X32 && Pmode == DImode (and (match_test "TARGET_X32 && Pmode == DImode")
&& !ix86_indirect_branch_register")
(match_operand 0 "GOT_memory_operand")))) (match_operand 0 "GOT_memory_operand"))))
(define_constraint "Bw" (define_constraint "Bw"
"@internal Call memory operand." "@internal Call memory operand."
(ior (and (not (match_test "TARGET_X32 (ior (and (not (match_test "ix86_indirect_branch_register"))
|| ix86_indirect_branch_register")) (not (match_test "TARGET_X32"))
(match_operand 0 "memory_operand")) (match_operand 0 "memory_operand"))
(and (match_test "TARGET_X32 && Pmode == DImode (and (match_test "TARGET_X32 && Pmode == DImode")
&& !ix86_indirect_branch_register")
(match_operand 0 "GOT_memory_operand")))) (match_operand 0 "GOT_memory_operand"))))
(define_constraint "Bz" (define_constraint "Bz"
......
...@@ -695,8 +695,7 @@ ...@@ -695,8 +695,7 @@
;; Return true if OP is a GOT memory operand. ;; Return true if OP is a GOT memory operand.
(define_predicate "GOT_memory_operand" (define_predicate "GOT_memory_operand"
(and (match_test "!ix86_indirect_branch_register") (match_operand 0 "memory_operand")
(match_operand 0 "memory_operand"))
{ {
op = XEXP (op, 0); op = XEXP (op, 0);
return (GET_CODE (op) == CONST return (GET_CODE (op) == CONST
...@@ -729,8 +728,7 @@ ...@@ -729,8 +728,7 @@
;; Return true if OP is a 32-bit GOT symbol operand. ;; Return true if OP is a 32-bit GOT symbol operand.
(define_predicate "GOT32_symbol_operand" (define_predicate "GOT32_symbol_operand"
(match_test "!ix86_indirect_branch_register (match_test "GET_CODE (op) == CONST
&& GET_CODE (op) == CONST
&& GET_CODE (XEXP (op, 0)) == UNSPEC && GET_CODE (XEXP (op, 0)) == UNSPEC
&& XINT (XEXP (op, 0), 1) == UNSPEC_GOT")) && XINT (XEXP (op, 0), 1) == UNSPEC_GOT"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment