MLIR 22.0.0git
mlir::LowerToLLVMOptions Class Reference

Options to control the LLVM lowering. More...

#include "mlir/Conversion/LLVMCommon/LoweringOptions.h"

Public Types

enum class  AllocLowering { Malloc , AlignedAlloc , None }

Public Member Functions

 LowerToLLVMOptions (MLIRContext *ctx)
 LowerToLLVMOptions (MLIRContext *ctx, const DataLayout &dl)
void overrideIndexBitwidth (unsigned bitwidth)
 Set the index bitwidth to the given value.
unsigned getIndexBitwidth () const
 Get the index bitwidth.

Public Attributes

bool useBarePtrCallConv = false
AllocLowering allocLowering = AllocLowering::Malloc
bool useGenericFunctions = false
llvm::DataLayout dataLayout = llvm::DataLayout("")
 The data layout of the module to produce.

Detailed Description

Options to control the LLVM lowering.

The struct is used to share lowering options between passes, patterns, and type converter.

Definition at line 30 of file LoweringOptions.h.

Member Enumeration Documentation

◆ AllocLowering

Enumerator
Malloc 

Use malloc for heap allocations.

AlignedAlloc 

Use aligned_alloc for heap allocations.

None 

Do not lower heap allocations.

Users must provide their own patterns for AllocOp and DeallocOp lowering.

Definition at line 37 of file LoweringOptions.h.

Constructor & Destructor Documentation

◆ LowerToLLVMOptions() [1/2]

mlir::LowerToLLVMOptions::LowerToLLVMOptions ( MLIRContext * ctx)
explicit

Definition at line 15 of file LoweringOptions.cpp.

References LowerToLLVMOptions().

Referenced by LowerToLLVMOptions().

◆ LowerToLLVMOptions() [2/2]

mlir::LowerToLLVMOptions::LowerToLLVMOptions ( MLIRContext * ctx,
const DataLayout & dl )

Definition at line 18 of file LoweringOptions.cpp.

References mlir::DataLayout::getTypeSizeInBits().

Member Function Documentation

◆ getIndexBitwidth()

unsigned mlir::LowerToLLVMOptions::getIndexBitwidth ( ) const
inline

Get the index bitwidth.

Definition at line 66 of file LoweringOptions.h.

◆ overrideIndexBitwidth()

void mlir::LowerToLLVMOptions::overrideIndexBitwidth ( unsigned bitwidth)
inline

Set the index bitwidth to the given value.

Definition at line 59 of file LoweringOptions.h.

References mlir::kDeriveIndexBitwidthFromDataLayout.

Member Data Documentation

◆ allocLowering

AllocLowering mlir::LowerToLLVMOptions::allocLowering = AllocLowering::Malloc

◆ dataLayout

llvm::DataLayout mlir::LowerToLLVMOptions::dataLayout = llvm::DataLayout("")

The data layout of the module to produce.

This must be consistent with the data layout used in the upper levels of the lowering pipeline.

Definition at line 56 of file LoweringOptions.h.

◆ useBarePtrCallConv

bool mlir::LowerToLLVMOptions::useBarePtrCallConv = false

◆ useGenericFunctions

bool mlir::LowerToLLVMOptions::useGenericFunctions = false

Definition at line 51 of file LoweringOptions.h.


The documentation for this class was generated from the following files: