forked from OSchip/llvm-project
[X86][AMX][NFC] Refactor X86LowerAMXCast.cpp
Change static function to X86LowerAMXCast member function. Differential Revision: https://reviews.llvm.org/D126058
This commit is contained in:
parent
f598dfb3bf
commit
d5999bd3f7
|
@ -703,6 +703,9 @@ class X86LowerAMXCast {
|
|||
|
||||
public:
|
||||
X86LowerAMXCast(Function &F) : Func(F) {}
|
||||
void combineCastStore(IntrinsicInst *Cast, StoreInst *ST);
|
||||
void combineLoadCast(IntrinsicInst *Cast, LoadInst *LD);
|
||||
bool combineLdSt(SmallVectorImpl<Instruction *> &Casts);
|
||||
bool combineAMXcast(TargetLibraryInfo *TLI);
|
||||
bool transformAMXCast(IntrinsicInst *AMXCast);
|
||||
bool transformAllAMXCast();
|
||||
|
@ -913,7 +916,7 @@ bool X86LowerAMXCast::optimizeAMXCastFromPhi(
|
|||
// -->
|
||||
// call void @llvm.x86.tilestored64.internal(i16 %row, i16 %col, i8* %p,
|
||||
// i64 64, x86_amx %42)
|
||||
static void combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
|
||||
void X86LowerAMXCast::combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
|
||||
Value *Tile = Cast->getOperand(0);
|
||||
// TODO: If it is cast intrinsic or phi node, we can propagate the
|
||||
// shape information through def-use chain.
|
||||
|
@ -939,7 +942,7 @@ static void combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
|
|||
// -->
|
||||
// %66 = call x86_amx @llvm.x86.tileloadd64.internal(i16 %row, i16 %col,
|
||||
// i8* %p, i64 64)
|
||||
static void combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
|
||||
void X86LowerAMXCast::combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
|
||||
Value *Row = nullptr, *Col = nullptr;
|
||||
Use &U = *(Cast->use_begin());
|
||||
unsigned OpNo = U.getOperandNo();
|
||||
|
@ -961,7 +964,7 @@ static void combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
|
|||
Cast->replaceAllUsesWith(NewInst);
|
||||
}
|
||||
|
||||
static bool combineLdSt(SmallVectorImpl<Instruction *> &Casts) {
|
||||
bool X86LowerAMXCast::combineLdSt(SmallVectorImpl<Instruction *> &Casts) {
|
||||
bool Change = false;
|
||||
for (auto *Cast : Casts) {
|
||||
auto *II = cast<IntrinsicInst>(Cast);
|
||||
|
|
Loading…
Reference in New Issue