MLIR  20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
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. More...
 
unsigned getIndexBitwidth () const
 Get the index bitwidth. More...
 

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. More...
 

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.

◆ LowerToLLVMOptions() [2/2]

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

Definition at line 18 of file LoweringOptions.cpp.

References mlir::get(), and 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.

Referenced by mlir::LLVMTypeConverter::getIndexTypeBitwidth().

◆ 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.

Referenced by mlir::LLVMTypeConverter::getDataLayout(), and mlir::LLVMTypeConverter::getPointerBitwidth().

◆ 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: