[llvm-dev] Updating RegMask inline

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Fri May 27 11:51:30 PDT 2016

> On May 27, 2016, at 11:49 AM, vivek pandya <vivekvpandya at gmail.com> wrote:
> Hello Mentors,
> I have completed writing simple register mask calculator pass, an immutable pass that stores RegMasks and provides API to query them, and a target specific pass for X86 target which currently iterates through all MI in given MF and if a call instruction is found then it quires for RegMask to Immutable pass and prints which registers are clobbered and preserved as per actual register allocation for callee function.
> So now I need to update RegMask for call instruction, so as per our previous discussion on IRC if we add a method to update RegMask, Do we have to do it in target specific way? Is it possible to have RegMask at fixed position in Operands array in MI? Also provide some more details on updating cached RegMask in various other class.

Add a method "setOperandMask()" in class MachineOperand, and then when you find a call you just walk all the operands till you find one which "isRegMask()" at which point you can update it.


More information about the llvm-dev mailing list