[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]

Chris Lattner clattner at apple.com
Fri Aug 22 14:14:31 PDT 2008


On Aug 22, 2008, at 10:34 AM, Vikram S. Adve wrote:

>>> unsigned integers are defined to wrap gracefully on
>>> overflow.  Other languages that target this may want some sort of
>>> command line option to control the behavior or the language may
>>> define
>>> it one way or the other.
>>>
>>> We don't model this in LLVM IR, but this is a desired feature if
>>> anyone is interested.  Capturing this in the IR is a better way to  
>>> go
>>> than having the optimizers have a big global knob.
>
>
> But signed and unsigned values are not distinguished any more in the
> LLVM IR, and I don't think you're suggesting we restore unsigned
> types.  What do you have in mind here?

This should be an attribute on the underlying operation.  For example,  
an i32 add should be tagged as:

  1) being defined to wrap on overflow
  2) being undefined on signed overflow
  3) being defined to saturate on signed overflow
  4) being undefined on unsigned overflow
  5) being defined to saturate on unsigned overflow
etc.

-Chris



More information about the llvm-dev mailing list