[LLVMdev] removing unnecessary ZEXT

Robert Lytton robert at xmos.com
Fri Sep 6 09:18:51 PDT 2013


Hi,

Within a basic block I can remove unnecessary register copies + zero sign extensions of  unsigned-8bit-loaded values by implementing isZExtFree() for ISD::LOAD nodes.
...But not between basic blocks.

The first block does a CopyFromReg of the unsigned-8bit-loaded vreg1 into a new vreg2.
The second block then does a unnecessary zext to vreg2.
What I want is the 2nd block to use the original vreg1!
What I am getting is one extra register clobber and two extra instructions.

I have looked at other targets to see what they do but can't see what I am missing.

Help please!
Thank you

Robert






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130906/57382f92/attachment.html>


More information about the llvm-dev mailing list