LLVM 24.0.0git
HardwareLoops.cpp File Reference

Insert hardware loop intrinsics into loops which are deemed profitable by the target, by querying TargetTransformInfo. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "hardware-loops"
#define HW_LOOPS_NAME   "Hardware Loop Insertion"

Functions

 STATISTIC (NumHWLoops, "Number of loops converted to hardware loops")
static void debugHWLoopFailure (const StringRef DebugMsg, Instruction *I)
static OptimizationRemarkAnalysis createHWLoopAnalysis (StringRef RemarkName, Loop *L, Instruction *I)
static bool CanGenerateTest (Loop *L, Value *Count)

Detailed Description

Insert hardware loop intrinsics into loops which are deemed profitable by the target, by querying TargetTransformInfo.

A hardware loop comprises of two intrinsics: one, outside the loop, to set the loop iteration count and another, in the exit block, to decrement the counter. The decremented value can either be carried through the loop via a phi or handled in some opaque way by the target.

Definition in file HardwareLoops.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "hardware-loops"

Definition at line 44 of file HardwareLoops.cpp.

◆ HW_LOOPS_NAME

#define HW_LOOPS_NAME   "Hardware Loop Insertion"

Definition at line 46 of file HardwareLoops.cpp.

Function Documentation

◆ CanGenerateTest()

◆ createHWLoopAnalysis()

OptimizationRemarkAnalysis createHWLoopAnalysis ( StringRef RemarkName,
Loop * L,
Instruction * I )
static

Definition at line 65 of file HardwareLoops.cpp.

References DEBUG_TYPE, DL, and I.

◆ debugHWLoopFailure()

void debugHWLoopFailure ( const StringRef DebugMsg,
Instruction * I )
static

Definition at line 53 of file HardwareLoops.cpp.

References llvm::dbgs(), and I.

◆ STATISTIC()

STATISTIC ( NumHWLoops ,
"Number of loops converted to hardware loops"  )