First Last Prev Next    No search results available
Details
: ARM THUMB: cpy instruction mustn't be emitted by default
Bug#: 1388
: libraries
: Backend: ARM
Status: NEW
Resolution:
: All
: All
: trunk
: P2
: critical
: ---

:
:
: 1401
:
  Show dependency tree - Show dependency graph
People
Reporter: Lauro Venancio <lauro.venancio@gmail.com>
Assigned To: Unassigned LLVM Bugs <unassignedbugs@nondot.org>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2007-05-05 09:49
The cpy instruction is only defined in ARMv6.
------- Comment #1 From Lauro Venancio 2007-05-07 17:13:43 -------
A possible solution for this bug is to emit 'mov' instead of 'cpy'. The problem
is that the mov sets the flags and I'm afraid that it can break something in
rematerialization. 

Cheng?
------- Comment #2 From Lauro Venancio 2007-05-08 16:36:08 -------
If all mov are changed to cpy, the backend emits wrong code:

        cmp r5, r2
        mov r0, r5
        bgt .LBB1_6     @cond_true99
------- Comment #3 From Evan Cheng 2007-05-08 17:24:23 -------
The proper fix is to model CC as explicit register(s). Then you can fix the
scheduler and register allocator, 
i.e. any machine instruction level module that insert move, load, store ops, to
insert instructions at the 
right spot to avoid clobbering the CC registers. Not only is it useful for this
bug, it also makes it easier to 
implement a pass that optimize away cmp / test, etc.

Perhaps it's ok to just add instruction properties that tells us whether a
instruction sets / reads CC. It's 
hard to say.
------- Comment #4 From Chris Lattner 2007-05-08 18:59:21 -------
removing me from cc list.  I am aka unassignedbugs@nondot, so I'm getting two
copies :)
------- Comment #5 From Chris Lattner 2007-05-08 19:00:18 -------
FWIW, I think that it is about time we start modelling CC's correctly.  This
would require, at the minimum, 
adding a new physreg to represent the CC, then marking each instruction that
sets it as clobbering it.

First Last Prev Next    No search results available