[LLVMdev] Adding "S" suffixed ARM/Thumb2 instructions

Bob Wilson bob.wilson at apple.com
Fri Feb 18 10:49:22 PST 2011


On Feb 17, 2011, at 10:35 PM, Вадим Марковцев wrote:

> Hello everyone,
> 
> I've added the "S" suffixed versions of ARM and Thumb2 instructions to tablegen. Those are, for example, "movs" or "muls".
> Of course, some instructions have already had their twins, such as add/adds, and I leaved them untouched.

Adding separate "s" instructions is not the right thing to do.  We've been trying hard to avoid adding those "twins".  The instructions that can optionally set the condition codes have an "optional def" operand.  For example, look at the "cc_out" operand in the "sI" class defined in ARMInstrFormats.td.  If that operand is set to the CPSR register, then the instruction becomes the "s" variant.

There are some existing peephole optimizations to make use of this, but there are some unresolved issues as well.  Do you have some example testcases that show where we're missing opportunities?



More information about the llvm-dev mailing list