From 41b485c9c35b90bb7ee55dca2d5375980e546039 Mon Sep 17 00:00:00 2001
From: Bill Wendling
This is an overloaded intrinsic. You can use llvm.umul.with.overflow +on any integer bit width.
+ ++ declare {i16, i1} @llvm.umul.with.overflow.i16(i16 %a, i16 %b) + declare {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b) + declare {i64, i1} @llvm.umul.with.overflow.i64(i64 %a, i64 %b) ++ +
Warning: 'llvm.umul.with.overflow' is badly broken. It is +actively being fixed, but it should not currently be used!
+ +The 'llvm.umul.with.overflow' family of intrinsic functions perform +a unsigned multiplication of the two arguments, and indicate whether an overflow +occurred during the unsigned multiplication.
+ +The arguments (%a and %b) and the first element of the result structure may +be of integer types of any bit width, but they must have the same bit width. The +second element of the result structure must be of type i1. %a +and %b are the two values that will undergo unsigned +multiplication.
+ +The 'llvm.umul.with.overflow' family of intrinsic functions perform +an unsigned multiplication of the two arguments. They return a structure — +the first element of which is the multiplication, and the second element of +which is a bit specifying if the unsigned multiplication resulted in an +overflow.
+ ++ %res = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b) + %sum = extractvalue {i32, i1} %res, 0 + %obit = extractvalue {i32, i1} %res, 1 + br i1 %obit, label %overflow, label %normal ++ +