This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: PATCH COMMITTED: Use conditional moves in groups of assignments


Joern RENNECKE <joern.rennecke@st.com> writes:

> However, even for if-conversion, I wonder what kind of inputs you
> could safely
> yet profitably use - in general, memory operands will be unsuitable
> because they
> can trap.  Or would this optimization be restricted to targets that
> can use such
> sources directly in a conditional move such that no trap occurs if the
> move is
> not actually done?

When branches are expensive and additions are cheap:

if (a)
  {
    b = x + y;
    c = w + z;
  }
else
  {
    d = 10;
    e = 100;
  }

Ian


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