[LLVMdev] Reference Manual Clarifications

Chris Lattner sabre at nondot.org
Mon Mar 31 10:24:47 PDT 2008


On Mon, 31 Mar 2008, Jonathan S. Shapiro wrote:
> Concrete example:
>
> What does a left shift of an i32 by 33 bits produce?

it is undefined in the llvm ir.

> The risk of making these operations defined is that we may become
> obligated to introduce conditional branches in the back end to check
> that registerized shift amounts are not out of range w.r.t. what the
> hardware can handle.

There is no risk, out of range shifts are undefined in llvm ir.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list