LLVM 18.0.0git
X86InstrFoldTables.h
Go to the documentation of this file.
1//===-- X86InstrFoldTables.h - X86 Instruction Folding Tables ---*- 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 contains the interface to query the X86 memory folding tables.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
14#define LLVM_LIB_TARGET_X86_X86INSTRFOLDTABLES_H
15
16#include <cstdint>
18
19namespace llvm {
20
21// This struct is used for both the folding and unfold tables. They KeyOp
22// is used to determine the sorting order.
24 unsigned KeyOp;
25 unsigned DstOp;
27
29 return KeyOp < RHS.KeyOp;
30 }
32 return KeyOp == RHS.KeyOp;
33 }
34 friend bool operator<(const X86MemoryFoldTableEntry &TE, unsigned Opcode) {
35 return TE.KeyOp < Opcode;
36 }
37};
38
39// Look up the memory folding table entry for folding a load and a store into
40// operand 0.
41const X86MemoryFoldTableEntry *lookupTwoAddrFoldTable(unsigned RegOp);
42
43// Look up the memory folding table entry for folding a load or store with
44// operand OpNum.
45const X86MemoryFoldTableEntry *lookupFoldTable(unsigned RegOp, unsigned OpNum);
46
47// Look up the memory unfolding table entry for this instruction.
48const X86MemoryFoldTableEntry *lookupUnfoldTable(unsigned MemOp);
49
50// Look up the broadcast memory folding table entry for this instruction from
51// the regular memory instruction.
52const X86MemoryFoldTableEntry *lookupBroadcastFoldTable(unsigned MemOp,
53 unsigned BroadcastBits);
54
55} // namespace llvm
56
57#endif
Value * RHS
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
const X86MemoryFoldTableEntry * lookupTwoAddrFoldTable(unsigned RegOp)
const X86MemoryFoldTableEntry * lookupBroadcastFoldTable(unsigned MemOp, unsigned BroadcastBits)
const X86MemoryFoldTableEntry * lookupFoldTable(unsigned RegOp, unsigned OpNum)
const X86MemoryFoldTableEntry * lookupUnfoldTable(unsigned MemOp)
bool operator==(const X86MemoryFoldTableEntry &RHS) const
bool operator<(const X86MemoryFoldTableEntry &RHS) const
friend bool operator<(const X86MemoryFoldTableEntry &TE, unsigned Opcode)