minwook Ahn
2010-Jan-20 07:55 UTC
[LLVMdev] [LLVMDev] Is there any way to eliminate zero-extension instruction?
Dear developers. We try to make our own backend of llvm for our target machine. Assume that we have the following code in our source code. int i = ( a < b ); The code is translated into r0 <- gt r1 r2 r3 <- and r0 0x1 We think that r3 is not necessary. Is there any way to eliminate it by just modifying our backend? Thank you in advance. Minwook Ahn -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100120/13ad88bb/attachment.html>
Richard Osborne
2010-Jan-20 08:52 UTC
[LLVMdev] [LLVMDev] Is there any way to eliminate zero-extension instruction?
On 20 Jan 2010, at 07:55, minwook Ahn wrote:> Dear developers. > > We try to make our own backend of llvm for our target machine. > > Assume that we have the following code in our source code. > > int i = ( a < b ); > > The code is translated into > > r0 <- gt r1 r2 > r3 <- and r0 0x1 > > We think that r3 is not necessary. Is there any way to eliminate it by just modifying > > our backend? > > Thank you in advance. > > Minwook AhnHave you told LLVM the result of setcc operations is 0 or 1? Add the following to the constructor of your ISelLowering class: setBooleanContents(ZeroOrOneBooleanContent); -- Richard Osborne | XMOS http://www.xmos.com
minwook Ahn
2010-Jan-21 01:14 UTC
[LLVMdev] [LLVMDev] Is there any way to eliminate zero-extension instruction?
Thank you for your reply.
In case of setcc, I saw it was removed.
But I could not delete the extension instruction in other cases of zero
extension from i1 to i32.
For example, in this case.
int main( int argc, char *argv[] ) {
int i = ( argc > 0 ) & ( argv != NULL );
return i;
}
So can you let us know how to remove it?
Thank you in advance.
Minwook Ahn
p.s. Sorry for the duplicated message if you get this twice.
2010/1/20 Richard Osborne <richard at xmos.com>
>
> On 20 Jan 2010, at 07:55, minwook Ahn wrote:
>
> > Dear developers.
> >
> > We try to make our own backend of llvm for our target machine.
> >
> > Assume that we have the following code in our source code.
> >
> > int i = ( a < b );
> >
> > The code is translated into
> >
> > r0 <- gt r1 r2
> > r3 <- and r0 0x1
> >
> > We think that r3 is not necessary. Is there any way to eliminate it by
> just modifying
> >
> > our backend?
> >
> > Thank you in advance.
> >
> > Minwook Ahn
>
> Have you told LLVM the result of setcc operations is 0 or 1? Add the
> following to the constructor of your ISelLowering class:
>
> setBooleanContents(ZeroOrOneBooleanContent);
>
> --
> Richard Osborne | XMOS
> http://www.xmos.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100121/cc5c4aeb/attachment.html>
Maybe Matching Threads
- [LLVMdev] [LLVMDev] Is there any way to eliminate zero-extension instruction?
- [LLVMdev] [LLVMDev] Is it possible to implement target specific optimizations which can be applied after instruction selection or later?
- [LLVMdev] [LLVMDev] Is it possible to implement target specific optimizations which can be applied after instruction selection or later?
- [LLVMdev] [LLVMDev] Does our own developed module and functions can go along with the future improved version of LLVM?
- [LLVMdev] [LLVMDev] Does our own developed module and functions can go along with the future improved version of LLVM?