[LLVMdev] LLVM API: how to determine if the register is the status register
Anton Korobeynikov
anton at korobeynikov.info
Wed Dec 8 05:29:57 PST 2010
Hello Vadim,
> CMP modifies the status register (e.g. CPSR in ARM). The question is, are
> there any modifications of the status register between those two compares.
> In other words, how to know if CPSR is changed in the code after the first
> CMP and before the second one.
After register allocation all the machine instructions have flags on
machine operands.
So, in this particular case you'll see that CPSR register is
implicitly defined by the first CMP.
After this you can look over def/kill/... flags on the operands of the
instruction to check whether
the register is used / changed in between.
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
More information about the llvm-dev
mailing list