[LLVMdev] precondition suggestion to LLVM

Niko Zarzani koni10 at hotmail.it
Mon Oct 22 21:33:02 PDT 2012


Thank you, it was what I really was searching for :)
However, I don't know if I well understood. I've find this link in the second link which seemed what i was looking for: http://nondot.org/sabre/LLVMNotes/BuiltinUnreachable.txt .If I put around the code block (inside my function with precondition (x>0 && y>0)) a contruct like that that use __builtin_unreachable:
int foo(int x, int y){
   if(x>0 && y>0){       ...function codeblock...   }   {      __builtin_unreachable ();    }
}

I can get the optimization without really having a branch jump in the machine code?Thank you again,
Niko Zarzani

> Date: Mon, 22 Oct 2012 23:41:43 -0400
> From: xi.wang at gmail.com
> To: koni10 at hotmail.it
> CC: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] precondition suggestion to LLVM
> 
> You may want to check this out:
> 
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/053924.html
> 
> and also
> 
> http://llvm.org/PR810
> 
> - xi
> 
> On 10/22/12 6:05 PM, Niko Zarzani wrote:
> > Hi all,
> > Is there any way to tell LLVM some additional information about the 
> > variables in the code in order to make better optimization?
> > For example, if my function has a certain precondition (such as x>0) 
> > then it will be possible to better optimize the code given that 
> > information (which the compiler does not know).
> > I am new in this field and I don't know if there are ways to tell the 
> > compiler preconditions (such as by using some preprocessing directives).
> > Thank you in advance,
> > Niko Zarzani
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121023/742c410f/attachment.html>


More information about the llvm-dev mailing list