LLVM  15.0.0git
IntrinsicLowering.h
Go to the documentation of this file.
1 //===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- 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 defines the IntrinsicLowering interface. This interface allows
10 // addition of domain-specific or front-end specific intrinsics to LLVM without
11 // having to modify all of the C backend or interpreter.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
16 #define LLVM_CODEGEN_INTRINSICLOWERING_H
17 
18 namespace llvm {
19 class CallInst;
20 class DataLayout;
21 
23  const DataLayout &DL;
24 
25  bool Warned = false;
26 
27 public:
28  explicit IntrinsicLowering(const DataLayout &DL) : DL(DL) {}
29 
30  /// Replace a call to the specified intrinsic function.
31  /// If an intrinsic function must be implemented by the code generator
32  /// (such as va_start), this function should print a message and abort.
33  ///
34  /// Otherwise, if an intrinsic function call can be lowered, the code to
35  /// implement it (often a call to a non-intrinsic function) is inserted
36  /// _after_ the call instruction and the call is deleted. The caller must
37  /// be capable of handling this kind of change.
38  void LowerIntrinsicCall(CallInst *CI);
39 
40  /// Try to replace a call instruction with a call to a bswap intrinsic. Return
41  /// false if the call is not a simple integer bswap.
42  static bool LowerToByteSwap(CallInst *CI);
43 };
44 }
45 
46 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:113
llvm::IntrinsicLowering::LowerToByteSwap
static bool LowerToByteSwap(CallInst *CI)
Try to replace a call instruction with a call to a bswap intrinsic.
Definition: IntrinsicLowering.cpp:454
llvm::IntrinsicLowering
Definition: IntrinsicLowering.h:22
llvm::IntrinsicLowering::IntrinsicLowering
IntrinsicLowering(const DataLayout &DL)
Definition: IntrinsicLowering.h:28
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1474
llvm::IntrinsicLowering::LowerIntrinsicCall
void LowerIntrinsicCall(CallInst *CI)
Replace a call to the specified intrinsic function.
Definition: IntrinsicLowering.cpp:224