This change better preserves the NSW/NUW flags in the reassociation pass.
Part of PR12985.
|  Differential  D6172  
[Reassociate] Better preserve NSW/NUW flags. (PR12985) Authored by mcrosier on Nov 7 2014, 10:28 AM. 
Details 
Diff Detail Event TimelineComment Actions This transform is not safe for nsw shl, it will transform %shl = shl nsw i32 %a, 31 into %shl = mul nsw i32 %a, -2147483648 If %a is -1, %shl should hold INT_MIN. Instead, it will transform it into poison. However, I think it's fine to turn a nuw shl into an nuw mul in all cases. 
 
 
 Comment Actions LGTM with tweaks. 
 | ||||||||||||||||||||||||
Shouldn't this be:
?