Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/SystemZ/SystemZInstrBuilder.h
Line
Count
Source
1
//===-- SystemZInstrBuilder.h - Functions to aid building insts -*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file exposes functions that may be used with BuildMI from the
10
// MachineInstrBuilder.h file to handle SystemZ'isms in a clean way.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZINSTRBUILDER_H
15
#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZINSTRBUILDER_H
16
17
#include "llvm/CodeGen/MachineFrameInfo.h"
18
#include "llvm/CodeGen/MachineInstrBuilder.h"
19
#include "llvm/CodeGen/MachineMemOperand.h"
20
#include "llvm/CodeGen/PseudoSourceValue.h"
21
22
namespace llvm {
23
24
/// Add a BDX memory reference for frame object FI to MIB.
25
static inline const MachineInstrBuilder &
26
2.79k
addFrameReference(const MachineInstrBuilder &MIB, int FI) {
27
2.79k
  MachineInstr *MI = MIB;
28
2.79k
  MachineFunction &MF = *MI->getParent()->getParent();
29
2.79k
  MachineFrameInfo &MFFrame = MF.getFrameInfo();
30
2.79k
  const MCInstrDesc &MCID = MI->getDesc();
31
2.79k
  auto Flags = MachineMemOperand::MONone;
32
2.79k
  if (MCID.mayLoad())
33
1.38k
    Flags |= MachineMemOperand::MOLoad;
34
2.79k
  if (MCID.mayStore())
35
1.40k
    Flags |= MachineMemOperand::MOStore;
36
2.79k
  int64_t Offset = 0;
37
2.79k
  MachineMemOperand *MMO = MF.getMachineMemOperand(
38
2.79k
      MachinePointerInfo::getFixedStack(MF, FI, Offset), Flags,
39
2.79k
      MFFrame.getObjectSize(FI), MFFrame.getObjectAlignment(FI));
40
2.79k
  return MIB.addFrameIndex(FI).addImm(Offset).addReg(0).addMemOperand(MMO);
41
2.79k
}
Unexecuted instantiation: SystemZFrameLowering.cpp:llvm::addFrameReference(llvm::MachineInstrBuilder const&, int)
SystemZInstrInfo.cpp:llvm::addFrameReference(llvm::MachineInstrBuilder const&, int)
Line
Count
Source
26
2.79k
addFrameReference(const MachineInstrBuilder &MIB, int FI) {
27
2.79k
  MachineInstr *MI = MIB;
28
2.79k
  MachineFunction &MF = *MI->getParent()->getParent();
29
2.79k
  MachineFrameInfo &MFFrame = MF.getFrameInfo();
30
2.79k
  const MCInstrDesc &MCID = MI->getDesc();
31
2.79k
  auto Flags = MachineMemOperand::MONone;
32
2.79k
  if (MCID.mayLoad())
33
1.38k
    Flags |= MachineMemOperand::MOLoad;
34
2.79k
  if (MCID.mayStore())
35
1.40k
    Flags |= MachineMemOperand::MOStore;
36
2.79k
  int64_t Offset = 0;
37
2.79k
  MachineMemOperand *MMO = MF.getMachineMemOperand(
38
2.79k
      MachinePointerInfo::getFixedStack(MF, FI, Offset), Flags,
39
2.79k
      MFFrame.getObjectSize(FI), MFFrame.getObjectAlignment(FI));
40
2.79k
  return MIB.addFrameIndex(FI).addImm(Offset).addReg(0).addMemOperand(MMO);
41
2.79k
}
42
43
} // end namespace llvm
44
45
#endif