[llvm-dev] XOR A, A treatment

James Courtier-Dutton via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 27 03:50:06 PDT 2018


Hi,

I am wondering about what suitable assembler level instruction substations
are.
For example:
Result = XOR Reg1, Reg1;

Result is always zero, with the flags cleared.
Could I substitute this for:
Result = XOR Constant0, Constant0;

Thus freeing up Reg1 usage.
I think this would be a valid substitution, but I wanted to check with the
knowledgeable people on this list as to whether I am missing something
important.

Other possible substitutions might be:
Result = XOR Reg2, Reg2;
Because it does not actually matter which reg is used.

Kind Regards

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180927/e68e4cd7/attachment.html>


More information about the llvm-dev mailing list