InstCombine tries to rewrite
%prod = mul nsw i64 %X, Scale %acc = add nsw i64 %prod, Offset %0 = alloca i8, i64 %acc, align 4 %1 = bitcast i8* %0 to i32* Use ( %1 )
into
%prod = mul nsw i64 %X, Scale/4 %acc = add nsw i64 %prod, Offset/4 %0 = alloca i32, i64 %acc, align 4 Use (%0)
But it assumes Scale is unsigned.
For now, bail out on negative operands to avoid an incorrect transformation.
Please use the llvm/utils/update_test_checks.py script to generate CHECK lines.
Also, I think that this test case may be reduced, I don't think you really need much more than then mul+add+alloca+bitcast sequence?