LLVM 20.0.0git
Macros | Functions | Variables
TypePromotion.cpp File Reference

This is an opcode based type promotion pass for small types that would otherwise be promoted during legalisation. More...

#include "llvm/CodeGen/TypePromotion.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "type-promotion"
 
#define PASS_NAME   "Type Promotion"
 

Functions

static bool GenerateSignBits (Instruction *I)
 
static bool isPromotedResultSafe (Instruction *I)
 Return whether we can safely mutate V's type to ExtTy without having to be concerned with zero extending or truncation.
 

Variables

static cl::opt< boolDisablePromotion ("disable-type-promotion", cl::Hidden, cl::init(false), cl::desc("Disable type promotion pass"))
 

Detailed Description

This is an opcode based type promotion pass for small types that would otherwise be promoted during legalisation.

This works around the limitations of selection dag for cyclic regions. The search begins from icmp instructions operands where a tree, consisting of non-wrapping or safe wrapping instructions, is built, checked and promoted if possible.

Definition in file TypePromotion.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "type-promotion"

Definition at line 42 of file TypePromotion.cpp.

◆ PASS_NAME

#define PASS_NAME   "Type Promotion"

Definition at line 43 of file TypePromotion.cpp.

Function Documentation

◆ GenerateSignBits()

static bool GenerateSignBits ( Instruction I)
static

Definition at line 201 of file TypePromotion.cpp.

References I.

Referenced by isPromotedResultSafe().

◆ isPromotedResultSafe()

static bool isPromotedResultSafe ( Instruction I)
static

Return whether we can safely mutate V's type to ExtTy without having to be concerned with zero extending or truncation.

Definition at line 401 of file TypePromotion.cpp.

References GenerateSignBits(), and I.

Variable Documentation

◆ DisablePromotion

cl::opt< bool > DisablePromotion("disable-type-promotion", cl::Hidden, cl::init(false), cl::desc("Disable type promotion pass")) ( "disable-type-promotion"  ,
cl::Hidden  ,
cl::init(false)  ,
cl::desc("Disable type promotion pass")   
)
static