[llvm-commits] Thumb2 and-tst peephole optimization

Gabor Greif gabor at mac.com
Tue Sep 21 15:27:25 PDT 2010


A non-text attachment was scrubbed...
Name: thumb2-and-tst-opt.diff
Type: application/octet-stream
Size: 3549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100922/4a3ac9d4/attachment.obj>
-------------- next part --------------


Hi all,

I am entering deeper waters with this patch, so I'd better put it
up to review...

I managed to eliminate the 'tst.w' instruction after a thumb2 'and'
by converting the latter to 'andS'.

Unfortunately the transformation is all but straightforward:

the 'tst.t' feeds on a register that is also ARM::COPYed and ends
up as the register argument to the 'and'.
So we have look through those copies to find the 'and'.
I am unsure whether I have gotten the logic right, as I want
to avoid a wildly branching algorithm and so I look for the
'and' only immediately behind the COPY.

Any hint how to get this coded up elegantly and efficiently
is welcome. The patch is attached.

Cheers,

	Gabor



More information about the llvm-commits mailing list