Hi, > > It seems like folding undef/X to undef isn't safe either though, with > > the way it sounds like undef is intended to work. This code: > > > > %x = udiv i32 undef, %intmax > > %y = udiv i32 %x, 2 > > > > will always set %y to 0. Maybe instcombine can fold the second > > udiv by looking through its operands, but it can't safely fold the > > first. The best it could do is try to fold away all of %x's uses so > > that %x isn't needed anymore.
presumably undef/X should be folded to 0. [This means that undef/0 gets folded to 0, not sure if that's OK]. Ciao, D. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits