[PATCH] D24327: [DAGCombine] Modification of visitBR_CC

bryant via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 02:11:41 PDT 2016


bryant added a comment.

In https://reviews.llvm.org/D24327#537057, @spatel wrote:

> > %2 = add %1, #const
>
> >  br_cc cond %2, #const
>
> >  -->
>
> >  br_cc cond %1, 0
>
>
> I don't think this transform is safe unless you have 'nsw' or 'nuw' on the add.


am i missing something obvious? if nsw/nuw are present, then %2 could potentially be undef, and the transform would elide this case and alter semantics. so wouldn't it be unsafe only if the flags are present?


https://reviews.llvm.org/D24327





More information about the llvm-commits mailing list