Use BranchProbability instead of floating points in IfConverter.
[llvm/stm8.git] / lib / Target / PTX / PTXRegisterInfo.cpp
blobf32c2b70a3bc07a49ee4c7d77765249f21cdbad2
1 //===- PTXRegisterInfo.cpp - PTX Register Information ---------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the PTX implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #include "PTX.h"
15 #include "PTXRegisterInfo.h"
16 #include "llvm/CodeGen/MachineFunction.h"
17 #include "llvm/Support/Debug.h"
18 #include "llvm/Support/raw_ostream.h"
20 #define GET_REGINFO_MC_DESC
21 #define GET_REGINFO_TARGET_DESC
22 #include "PTXGenRegisterInfo.inc"
24 using namespace llvm;
26 PTXRegisterInfo::PTXRegisterInfo(PTXTargetMachine &TM,
27 const TargetInstrInfo &TII)
28 : PTXGenRegisterInfo() {
31 void PTXRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
32 int SPAdj,
33 RegScavenger *RS) const {
34 unsigned Index;
35 MachineInstr& MI = *II;
37 Index = 0;
38 while (!MI.getOperand(Index).isFI()) {
39 ++Index;
40 assert(Index < MI.getNumOperands() &&
41 "Instr does not have a FrameIndex operand!");
44 int FrameIndex = MI.getOperand(Index).getIndex();
46 DEBUG(dbgs() << "eliminateFrameIndex: " << MI);
47 DEBUG(dbgs() << "- SPAdj: " << SPAdj << "\n");
48 DEBUG(dbgs() << "- FrameIndex: " << FrameIndex << "\n");
50 // This frame index is post stack slot re-use assignments
51 MI.getOperand(Index).ChangeToImmediate(FrameIndex);