SSA-form and cmove

Tommy Hoffner <>
13 Aug 2000 18:50:52 -0400

          From comp.compilers

Related articles
SSA-form and cmove (Tommy Hoffner) (2000-08-13)
Re: SSA-form and cmove (Stephen Clarke) (2000-08-20)
Re: SSA-form and cmove (Tim Harris) (2000-08-27)
Re: SSA-form and cmove (2000-09-02)
Re: SSA-form and cmove (2000-09-13)
| List of all articles for this month |

From: Tommy Hoffner <>
Newsgroups: comp.compilers
Date: 13 Aug 2000 18:50:52 -0400
Organization: Ericsson SoftLab AB
Keywords: analysis

We are currently developing a binary translator or a highly optimizing
CISC to RISC compiler. The largest part of optimization is done on a RISC
like intermediary language.
We have run into some problem in generating SSA form when introducing a
cmove (conditional move) instruction into the intermediary language.
Currently we are considering one of the following two approaches:
make the cmove a four operand instruction e.g.,
cmove cond, oldval, newval, result
thus forcing single assignment on the instruction

introduce a phi node immediately after the cmove instruction,
joining the original value with the possible new value (haven't
figured out the details yet, if it is possible at all :-)

The first apporoach will as I understand it work, but it will have to be
expanded to a move and a cmove after register allocation with little or
no hope of eliminating unnessecary introduced move instructions
afterwards as well as risking the allocation of an extra register

Is there any other RISC instructions that is inherently none SSA?
( cmove cond, newval, result is per definition a possible second
assignment to result, right?)

Is it possible to solve it with the second approach? Or is there any
other way to handle this?

-- =

Tommy Hoffner Senior Consultant Ericsson SoftLab AB
E-mail: Phone: +46 13 23 57 12
Address:Datalinjen 1, 583 30 Link=F6ping, Sweden

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.