Skip to content

Commit d5999bd

Browse files
committed
[X86][AMX][NFC] Refactor X86LowerAMXCast.cpp
Change static function to X86LowerAMXCast member function. Differential Revision: https://reviews.llvm.org/D126058
1 parent f598dfb commit d5999bd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Target/X86/X86LowerAMXType.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ class X86LowerAMXCast {
703703

704704
public:
705705
X86LowerAMXCast(Function &F) : Func(F) {}
706+
void combineCastStore(IntrinsicInst *Cast, StoreInst *ST);
707+
void combineLoadCast(IntrinsicInst *Cast, LoadInst *LD);
708+
bool combineLdSt(SmallVectorImpl<Instruction *> &Casts);
706709
bool combineAMXcast(TargetLibraryInfo *TLI);
707710
bool transformAMXCast(IntrinsicInst *AMXCast);
708711
bool transformAllAMXCast();
@@ -913,7 +916,7 @@ bool X86LowerAMXCast::optimizeAMXCastFromPhi(
913916
// -->
914917
// call void @llvm.x86.tilestored64.internal(i16 %row, i16 %col, i8* %p,
915918
// i64 64, x86_amx %42)
916-
static void combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
919+
void X86LowerAMXCast::combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
917920
Value *Tile = Cast->getOperand(0);
918921
// TODO: If it is cast intrinsic or phi node, we can propagate the
919922
// shape information through def-use chain.
@@ -939,7 +942,7 @@ static void combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
939942
// -->
940943
// %66 = call x86_amx @llvm.x86.tileloadd64.internal(i16 %row, i16 %col,
941944
// i8* %p, i64 64)
942-
static void combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
945+
void X86LowerAMXCast::combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
943946
Value *Row = nullptr, *Col = nullptr;
944947
Use &U = *(Cast->use_begin());
945948
unsigned OpNo = U.getOperandNo();
@@ -961,7 +964,7 @@ static void combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
961964
Cast->replaceAllUsesWith(NewInst);
962965
}
963966

964-
static bool combineLdSt(SmallVectorImpl<Instruction *> &Casts) {
967+
bool X86LowerAMXCast::combineLdSt(SmallVectorImpl<Instruction *> &Casts) {
965968
bool Change = false;
966969
for (auto *Cast : Casts) {
967970
auto *II = cast<IntrinsicInst>(Cast);

0 commit comments

Comments
 (0)