|
LLVM 23.0.0git
|
This file defines the WebAssembly-specific support for the FastISel class. More...
#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"#include "Utils/WasmAddressSpaces.h"#include "Utils/WebAssemblyTypeUtilities.h"#include "WebAssemblyMachineFunctionInfo.h"#include "WebAssemblySubtarget.h"#include "WebAssemblyUtilities.h"#include "llvm/Analysis/BranchProbabilityInfo.h"#include "llvm/CodeGen/FastISel.h"#include "llvm/CodeGen/FunctionLoweringInfo.h"#include "llvm/CodeGen/MachineConstantPool.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/GetElementPtrTypeIterator.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/Operator.h"#include "WebAssemblyGenFastISel.inc"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "wasm-fastisel" |
This file defines the WebAssembly-specific support for the FastISel class.
Some of the target-specific code is generated by tablegen in the file WebAssemblyGenFastISel.inc, which is #included here.
TODO: kill flags
Definition in file WebAssemblyFastISel.cpp.
| #define DEBUG_TYPE "wasm-fastisel" |
Definition at line 42 of file WebAssemblyFastISel.cpp.
|
static |
Definition at line 1380 of file WebAssemblyFastISel.cpp.
References llvm::MachineInstr::getOpcode(), llvm::Type::getPrimitiveSizeInBits(), getSExtLoadOpcode(), llvm::Value::getType(), getZExtLoadOpcode(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), and llvm::MachineRegisterInfo::use_instr_nodbg_begin().
Referenced by matchFoldableAnd(), and matchFoldableShift().
|
static |
Definition at line 1368 of file WebAssemblyFastISel.cpp.
References llvm::Type::getPrimitiveSizeInBits(), getSExtLoadOpcode(), llvm::Value::getType(), isFoldableSExtOpcode(), isI64SExtResult(), MI, and Opc.
Definition at line 1287 of file WebAssemblyFastISel.cpp.
Referenced by getFoldedI64LoadOpcode(), getFoldedLoadOpcode(), matchFoldableCopyToI64Ext(), matchFoldableSExtFromPromotedI32(), and matchFoldableShift().
Definition at line 1313 of file WebAssemblyFastISel.cpp.
Referenced by getFoldedI64LoadOpcode(), matchFoldableAnd(), and matchFoldableCopyToI64Ext().
Definition at line 1339 of file WebAssemblyFastISel.cpp.
References Opc.
Referenced by getFoldedLoadOpcode().
Definition at line 1353 of file WebAssemblyFastISel.cpp.
References llvm_unreachable, and Opc.
Referenced by getFoldedLoadOpcode().
|
static |
Definition at line 1504 of file WebAssemblyFastISel.cpp.
References DefMI, getFoldedI64LoadOpcode(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::MachineRegisterInfo::getUniqueVRegDef(), getZExtLoadOpcode(), I, llvm::maskTrailingOnes(), MI, and Reg.
|
static |
Definition at line 1479 of file WebAssemblyFastISel.cpp.
References llvm::MachineInstr::getOpcode(), llvm::Type::getPrimitiveSizeInBits(), getSExtLoadOpcode(), llvm::Value::getType(), getZExtLoadOpcode(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), MI, and llvm::MachineRegisterInfo::use_instr_nodbg_begin().
|
static |
Definition at line 1451 of file WebAssemblyFastISel.cpp.
References llvm::MachineInstr::getOpcode(), llvm::Type::getPrimitiveSizeInBits(), getSExtLoadOpcode(), llvm::Value::getType(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), MI, and llvm::MachineRegisterInfo::use_instr_nodbg_begin().
|
static |
Matches a sign-extension pattern (shl + shr_s) to fold it into a signed load.
FastISel assumes that 'sext' from i8 or i16 will first be lowered to a 32-bit zero-extending load (i32.load8_u / i32.load16_u) followed by 32-bit shifts, even when extending to i64. Therefore, this function only matches 32-bit shifts (SHL_I32 / SHR_S_I32) and specifically checks if both shift amounts are identical, compile-time constants that match the exact extension size (32 - LoadBitWidth).
Definition at line 1408 of file WebAssemblyFastISel.cpp.
References getFoldedI64LoadOpcode(), llvm::Type::getIntegerBitWidth(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), getSExtLoadOpcode(), llvm::Value::getType(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::MachineRegisterInfo::hasOneNonDBGUse(), llvm::Type::isIntegerTy(), MI, Opc, and llvm::MachineRegisterInfo::use_instr_nodbg_begin().