[llvm] d5999bd - [X86][AMX][NFC] Refactor X86LowerAMXCast.cpp

via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 04:32:28 PDT 2022


Author: Luo, Yuanke
Date: 2022-05-20T19:32:09+08:00
New Revision: d5999bd3f7528db844f95479d6a66be4ac6c79c6

URL: https://github.com/llvm/llvm-project/commit/d5999bd3f7528db844f95479d6a66be4ac6c79c6
DIFF: https://github.com/llvm/llvm-project/commit/d5999bd3f7528db844f95479d6a66be4ac6c79c6.diff

LOG: [X86][AMX][NFC] Refactor X86LowerAMXCast.cpp

Change static function to X86LowerAMXCast member function.

Differential Revision: https://reviews.llvm.org/D126058

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86LowerAMXType.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86LowerAMXType.cpp b/llvm/lib/Target/X86/X86LowerAMXType.cpp
index 81f258dc9659..540182cb7911 100644
--- a/llvm/lib/Target/X86/X86LowerAMXType.cpp
+++ b/llvm/lib/Target/X86/X86LowerAMXType.cpp
@@ -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);


        


More information about the llvm-commits mailing list