|
LLVM
3.7.0
|
SALU instructions ignore control flow, so we need to modify the live ranges of the registers they define in some cases. More...
#include "AMDGPU.h"#include "SIInstrInfo.h"#include "SIRegisterInfo.h"#include "llvm/CodeGen/LiveIntervalAnalysis.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachinePostDominators.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetMachine.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "si-fix-sgpr-live-ranges" |
Functions | |
| INITIALIZE_PASS_BEGIN (SIFixSGPRLiveRanges, DEBUG_TYPE,"SI Fix SGPR Live Ranges", false, false) INITIALIZE_PASS_END(SIFixSGPRLiveRanges | |
Variables | |
| DEBUG_TYPE | |
| SI Fix SGPR Live | Ranges |
| SI Fix SGPR Live | false |
SALU instructions ignore control flow, so we need to modify the live ranges of the registers they define in some cases.
The main case we need to handle is when a def is used in one side of a branch and not another. For example:
def IF ... ... ELSE use ... ENDIF
Here we need the register allocator to avoid assigning any of the defs inside of the IF to the same register as def. In traditional live interval analysis def is not live inside the IF branch, however, since SALU instructions inside of IF will be executed even if the branch is not taken, there is the chance that one of the instructions will overwrite the value of def, so the use in ELSE will see the wrong value.
The strategy we use for solving this is to add an extra use after the ENDIF:
def IF ... ... ELSE use ... ENDIF use
Adding this use will make the def live thoughout the IF branch, which is what we want.
Definition in file SIFixSGPRLiveRanges.cpp.
| #define DEBUG_TYPE "si-fix-sgpr-live-ranges" |
Definition at line 62 of file SIFixSGPRLiveRanges.cpp.
| INITIALIZE_PASS_BEGIN | ( | SIFixSGPRLiveRanges | , |
| DEBUG_TYPE | , | ||
| "SI Fix SGPR Live Ranges" | , | ||
| false | , | ||
| false | |||
| ) |
| DEBUG_TYPE |
Definition at line 95 of file SIFixSGPRLiveRanges.cpp.
| SI Fix SGPR Live false |
Definition at line 95 of file SIFixSGPRLiveRanges.cpp.
| SI Fix SGPR Live Ranges |
Definition at line 95 of file SIFixSGPRLiveRanges.cpp.
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::FastISel::createMachineMemOperandFor(), llvm::DbgValueHistoryMap::endInstrRange(), llvm::SelectionDAG::getLoad(), llvm::DbgValueHistoryMap::getRegisterForVar(), isKnownNonZero(), llvm::DwarfDebug::isLexicalScopeDIENull(), llvm::yaml::Scanner::printError(), and llvm::DbgValueHistoryMap::startInstrRange().
1.8.6