diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp b/gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp index 00cbd24b84f..0e788df1c9c 100644 --- a/gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp +++ b/gnu/llvm/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp @@ -1,4 +1,4 @@ -//===-- R600ControlFlowFinalizer.cpp - Finalize Control Flow Inst----------===// +//===- R600ControlFlowFinalizer.cpp - Finalize Control Flow Inst ----------===// // // The LLVM Compiler Infrastructure // @@ -9,7 +9,8 @@ // /// \file /// This pass compute turns all control flow pseudo instructions into native one -/// computing their address on the fly ; it also sets STACK_SIZE info. +/// computing their address on the fly; it also sets STACK_SIZE info. +// //===----------------------------------------------------------------------===// #include "AMDGPU.h" @@ -29,13 +30,15 @@ #include "llvm/CodeGen/MachineOperand.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DebugLoc.h" +#include "llvm/IR/Function.h" +#include "llvm/Pass.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <cassert> #include <cstdint> -#include <new> #include <set> #include <utility> #include <vector> @@ -47,7 +50,6 @@ using namespace llvm; namespace { struct CFStack { - enum StackItem { ENTRY = 0, SUB_ENTRY = 1, @@ -214,7 +216,7 @@ void CFStack::popLoop() { class R600ControlFlowFinalizer : public MachineFunctionPass { private: - typedef std::pair<MachineInstr *, std::vector<MachineInstr *>> ClauseFile; + using ClauseFile = std::pair<MachineInstr *, std::vector<MachineInstr *>>; enum ControlFlowInstruction { CF_TC, @@ -230,7 +232,6 @@ private: CF_END }; - static char ID; const R600InstrInfo *TII = nullptr; const R600RegisterInfo *TRI = nullptr; unsigned MaxFetchInst; @@ -499,6 +500,8 @@ private: } public: + static char ID; + R600ControlFlowFinalizer() : MachineFunctionPass(ID) {} bool runOnMachineFunction(MachineFunction &MF) override { @@ -509,14 +512,14 @@ public: R600MachineFunctionInfo *MFI = MF.getInfo<R600MachineFunctionInfo>(); - CFStack CFStack(ST, MF.getFunction()->getCallingConv()); + CFStack CFStack(ST, MF.getFunction().getCallingConv()); for (MachineFunction::iterator MB = MF.begin(), ME = MF.end(); MB != ME; ++MB) { MachineBasicBlock &MBB = *MB; unsigned CfCount = 0; std::vector<std::pair<unsigned, std::set<MachineInstr *>>> LoopStack; std::vector<MachineInstr * > IfThenElseStack; - if (MF.getFunction()->getCallingConv() == CallingConv::AMDGPU_VS) { + if (MF.getFunction().getCallingConv() == CallingConv::AMDGPU_VS) { BuildMI(MBB, MBB.begin(), MBB.findDebugLoc(MBB.begin()), getHWInstrDesc(CF_CALL_FS)); CfCount++; @@ -702,9 +705,16 @@ public: } }; +} // end anonymous namespace + +INITIALIZE_PASS_BEGIN(R600ControlFlowFinalizer, DEBUG_TYPE, + "R600 Control Flow Finalizer", false, false) +INITIALIZE_PASS_END(R600ControlFlowFinalizer, DEBUG_TYPE, + "R600 Control Flow Finalizer", false, false) + char R600ControlFlowFinalizer::ID = 0; -} // end anonymous namespace +char &llvm::R600ControlFlowFinalizerID = R600ControlFlowFinalizer::ID; FunctionPass *llvm::createR600ControlFlowFinalizer() { return new R600ControlFlowFinalizer(); |
