[llvm-commits] InstCombining, small bug alloca + bitcast
Stepan Dyatkovskiy
stpworld at narod.ru
Mon May 7 12:14:41 PDT 2012
Hi Duncan. Well... now I see that this "if" + old test (that by some
strange reasons uses nsw instead of nuw) looks really strange. Let me
some time, I either commented well this function or try to change this
"if" with some way.
-Stepan.
Duncan Sands wrote:
> Hi Stepan,
>
>> I also added some usefull checks to test and fixed InstCombineCasts.cpp.
>
> what was wrong with InstCombineCasts? In fact the existing check
>
> // Cannot look past anything that might overflow.
> OverflowingBinaryOperator *OBI = dyn_cast<OverflowingBinaryOperator>(Val);
> if (OBI&& !OBI->hasNoUnsignedWrap()) {
> Scale = 1;
> Offset = 0;
> return Val;
> }
>
> looks bogus to me: without it, you correctly get Scale and Offset such that
> Val = X*Scale + Offset, which is what the routine is supposed to do according
> to the comment describing it.
>
> So if this check is really needed, it must be because of some undocumented
> semantics in how the routine is supposed to behave. What are these semantics?
> They should be documented. Once it is clear what this routine is supposed to
> be doing, it should become clear whether your change is correct or not.
>
> Ciao, Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list