LLVM 24.0.0git
SIModeRegister.cpp File Reference

This pass inserts changes to the Mode register settings as required. More...

#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include <optional>
#include <queue>

Go to the source code of this file.

Classes

struct  Status
class  BlockData

Macros

#define DEBUG_TYPE   "si-mode-register"

Functions

 STATISTIC (NumSetregInserted, "Number of setreg of mode register inserted.")
static bool isFPTruncRoundPseudo (const MachineInstr &MI)
static bool mayNeedNonDefaultMode (const MachineInstr &MI)
static std::optional< std::pair< unsigned, unsigned > > getModeSetregField (const MachineInstr &MI, const SIInstrInfo *TII)
static bool isReturnToCaller (const MachineInstr &MI)

Detailed Description

This pass inserts changes to the Mode register settings as required.

Note that currently it only deals with the Double Precision Floating Point rounding mode setting, but is intended to be generic enough to be easily expanded.

Definition in file SIModeRegister.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-mode-register"

Definition at line 23 of file SIModeRegister.cpp.

Function Documentation

◆ getModeSetregField()

std::optional< std::pair< unsigned, unsigned > > getModeSetregField ( const MachineInstr & MI,
const SIInstrInfo * TII )
static

Definition at line 202 of file SIModeRegister.cpp.

References llvm::maskTrailingOnes(), MI, llvm::Offset, and TII.

◆ isFPTruncRoundPseudo()

bool isFPTruncRoundPseudo ( const MachineInstr & MI)
static

Definition at line 175 of file SIModeRegister.cpp.

References MI.

Referenced by mayNeedNonDefaultMode().

◆ isReturnToCaller()

bool isReturnToCaller ( const MachineInstr & MI)
static

Definition at line 221 of file SIModeRegister.cpp.

References MI.

◆ mayNeedNonDefaultMode()

bool mayNeedNonDefaultMode ( const MachineInstr & MI)
static

Definition at line 189 of file SIModeRegister.cpp.

References isFPTruncRoundPseudo(), and MI.

◆ STATISTIC()

STATISTIC ( NumSetregInserted ,
"Number of setreg of mode register inserted."  )