Function const_nsw_mul

Source
pub fn const_nsw_mul(lhs: &ValueRef, rhs: &ValueRef) -> ValueRef
Expand description

Create a NSW (No Signed Wrap) multiplication operation on two constant values.

§Details

Creates a new constant integer value representing the multiplication of two constant integer values, with the nsw (No Signed Wrap) flag set.

This function wraps the LLVMConstNSWMul function from the LLVM core library, which performs the multiplication of two constant integer values and returns the result as a new constant value. The nsw flag indicates that signed overflow is not allowed, and if it occurs, the program’s behavior will be undefined. This allows LLVM to optimize the code under the assumption that overflow does not happen during the multiplication.

§Arguments

  • lhs - A reference to the left-hand side (LHS) constant integer value.
  • rhs - A reference to the right-hand side (RHS) constant integer value.

§Returns

Returns a new constant integer value representing the product of lhs and rhs with the nsw flag set.