Coverage Report

Created: 2018-11-16 02:38

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
Line
Count
Source
1
//== llvm/CodeGen/GlobalISel/LegalizePass.h ------------- -*- C++ -*-==//
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
/// \file A pass to convert the target-illegal operations created by IR -> MIR
11
/// translation into ones the target expects to be able to select. This may
12
/// occur in multiple phases, for example G_ADD <2 x i8> -> G_ADD <2 x i16> ->
13
/// G_ADD <4 x i16>.
14
///
15
/// The LegalizeHelper class is where most of the work happens, and is designed
16
/// to be callable from other passes that find themselves with an illegal
17
/// instruction.
18
//
19
//===----------------------------------------------------------------------===//
20
21
#ifndef LLVM_CODEGEN_GLOBALISEL_LEGALIZEMACHINEIRPASS_H
22
#define LLVM_CODEGEN_GLOBALISEL_LEGALIZEMACHINEIRPASS_H
23
24
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
25
#include "llvm/CodeGen/MachineFunctionPass.h"
26
27
namespace llvm {
28
29
class MachineRegisterInfo;
30
31
class Legalizer : public MachineFunctionPass {
32
public:
33
  static char ID;
34
35
private:
36
37
  /// Initialize the field members using \p MF.
38
  void init(MachineFunction &MF);
39
40
public:
41
  // Ctor, nothing fancy.
42
  Legalizer();
43
44
6.95k
  StringRef getPassName() const override { return "Legalizer"; }
45
46
  void getAnalysisUsage(AnalysisUsage &AU) const override;
47
48
6.94k
  MachineFunctionProperties getRequiredProperties() const override {
49
6.94k
    return MachineFunctionProperties().set(
50
6.94k
        MachineFunctionProperties::Property::IsSSA);
51
6.94k
  }
52
53
6.94k
  MachineFunctionProperties getSetProperties() const override {
54
6.94k
    return MachineFunctionProperties().set(
55
6.94k
        MachineFunctionProperties::Property::Legalized);
56
6.94k
  }
57
58
  bool combineExtracts(MachineInstr &MI, MachineRegisterInfo &MRI,
59
                       const TargetInstrInfo &TII);
60
61
  bool runOnMachineFunction(MachineFunction &MF) override;
62
};
63
} // End namespace llvm.
64
65
#endif