MLIR  19.0.0git
Functions
SlowMPInt.cpp File Reference
#include "mlir/Analysis/Presburger/SlowMPInt.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <functional>

Go to the source code of this file.

Functions

static unsigned getMaxWidth (const APInt &a, const APInt &b)
 
APInt runOpWithExpandOnOverflow (const APInt &a, const APInt &b, llvm::function_ref< APInt(const APInt &, const APInt &, bool &overflow)> op)
 Bring a and b to have the same width and then call op(a, b, overflow). More...
 

Function Documentation

◆ getMaxWidth()

static unsigned getMaxWidth ( const APInt &  a,
const APInt &  b 
)
static

◆ runOpWithExpandOnOverflow()

APInt runOpWithExpandOnOverflow ( const APInt &  a,
const APInt &  b,
llvm::function_ref< APInt(const APInt &, const APInt &, bool &overflow)>  op 
)

Bring a and b to have the same width and then call op(a, b, overflow).


Arithmetic operators.

If the overflow bit becomes set, resize a and b to double the width and call op(a, b, overflow), returning its result. The operation with double widths should not also overflow.

Definition at line 176 of file SlowMPInt.cpp.

Referenced by mlir::presburger::detail::SlowMPInt::operator*(), mlir::presburger::detail::SlowMPInt::operator+(), mlir::presburger::detail::SlowMPInt::operator-(), and mlir::presburger::detail::SlowMPInt::operator/().