[llvm-dev] Semantics of MachineInstr::findRegisterUseOperandIdx
Fraser Cormack via llvm-dev
llvm-dev at lists.llvm.org
Tue Oct 4 04:00:41 PDT 2016
Hi,
I was wondering what MachineInstr::findRegisterUseOperandIdx "means". I
have a situation where an instruction writes R0 and another reads R0lo -
the lower half of R0. Using Use::findRegisterUseOperandIdx(R0) returns
-1, because it only checks against exact matches and
"is-Reg-a-subreg-of-MOReg" matches, of which neither are true.
However, the instruction reads _part_ of R0, so should it return true?
It's really a question of semantics, as either:
1) findRegisterUseOperandIdx returns the index if the instruction reads
the /whole/ of Reg, or
2) findRegisterUseOperandIdx returns the index if the instruction reads
/any part/ of Reg
If it's 2) then it appears as if there's a bug in there. If it's 1) by
design, then it doesn't seem to me as though there's a convenient way of
doing 2).
There is another option, namely:
3) findRegisterUseOperandIdx can do 1) or 2), depending on a flag
There's an "Overlap" parameter to
MachineInstr::findRegisterDefOperandIdx - would that do the trick, and
do we want to add it to findRegisterUseOperandIdx?
What do people think?
Cheers,
Fraser
--
Fraser Cormack
Staff Software Engineer, Compilers
Codeplay Software Ltd
Level C, Argyle House
3 Lady Lawson St,
Edinburgh EH3 9DR
Tel: +44 (0)131 466 0503
Website: http://www.codeplay.com
Twitter: https://twitter.com/codeplaysoft
This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it, or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: Regent House, 316 Beulah Hill, London, United Kingdom, SE19 3HF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161004/eb548ea7/attachment.html>
More information about the llvm-dev
mailing list