[LLVMdev] nsw/nuw for trunc
John McCall
rjmccall at apple.com
Thu Aug 11 11:32:40 PDT 2011
On Aug 11, 2011, at 11:03 AM, Chris Lattner wrote:
>
> On Aug 11, 2011, at 5:17 AM, Florian Merz wrote:
>
>> Hi everyone,
>>
>> we'd like to be able to check for loss of information in trunc operations in
>> our LLVM-based bounded model checker [1]. For this it is important if the
>> trunc was on a signed or unsigned integer, so we need nsw and nuw flags for
>> this. Would you accept a patch that adds these flags to LLVM (and possibly
>> clang)?
>
> In contrast to the other folks, I think that this makes perfect sense, and NSW/NUW are the right thing to use.
I agree that there's some abstract consistency in providing nsw/nuw
for trunc, even if no current frontends would ever emit it, but I do not
get the impression that Florian actually wants the optimizer making
random transformations based on the assumed undefined behavior
of these truncations.
John.
More information about the llvm-dev
mailing list