This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Swap optimization pass


At 10:19 PM -0500 1/11/98, John Wehle wrote:

 * Hello,
 *
 * Here's an initial implementation of a swap optimization pass.  The

Well, I'm sure it finds a lot of things this misses, (and possibly
avoids register pressure problems), but I'll bet that putting
something like this into your MD file would get 90% there and is
way faster.....


Note, my machine has a very high-level assembly language, so an
exchange is just doing both assignments in parallel, since the register
ports latch....

Here's the extract from the 21k.md file....

;
; Look for: swap
;
;    rA=rB;
;    rB=rC;
;    rC=rA;  && last use of rA
;
(define_peephole
  [(set (match_operand 0 "datareg_operand" "") (match_operand 1
  "datareg_operand" ""))
   (set (match_dup 1) (match_operand 2 "datareg_operand" ""))
   (set (match_dup 2) (match_dup 0))]
  "dead_or_set_p (insn, operands[0])"
  "%1=pass %2, %2=%1;"
  [(set_attr "length" "1")
   (set_attr "mode" "CCSET")
   (set_attr "cc" "clobber")
   (set_attr "type" "misc")]
)

------------------------------------------------------------------------

		    Quality Software Management
		http://www.tiac.net/users/lehotsky
			lehotsky@tiac.net
			(617)862-5418 Voice
			(617)674-1096 FAX

	Software Process Improvement and Management Consulting
	     Language Design and Compiler Implementation




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]