[llvm-dev] Incorrect placement of an instruction after PostRAScheduler pass

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 3 23:23:04 PST 2018


Hi Bharathi,

On Tue, 4 Dec 2018 at 06:23, Bharathi Seshadri via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> After the Post RA Scheduling pass, note that CMPri %R12 has been moved
> up the INLINE ASM. Since the inline asm has a {cmp, bne} pair, it is
> incorrect to move the CMPri before the inline assembly block.
> How do I prevent CMPri from being overridden by the cmp within the
> inline asm block. Could it be that some dependency is incorrectly
> specified ?

You need to tell clang that you're clobbering CPSR in the asm block so
that it doesn't think it can remain live across it. For some reason
that's spelled "cc" in ARM land. So you'd write something like:

    asm("ldaxr ..." : /* outputs */ : /* inputs */ : "cc");

Cheers.

Tim.


More information about the llvm-dev mailing list