[PATCH] D126058: [X86][AMX][NFC] Refactor X86LowerAMXCast.cpp

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


LuoYuanke created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
LuoYuanke requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Change static function to X86LowerAMXCast member function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126058

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


Index: llvm/lib/Target/X86/X86LowerAMXType.cpp
===================================================================
--- llvm/lib/Target/X86/X86LowerAMXType.cpp
+++ llvm/lib/Target/X86/X86LowerAMXType.cpp
@@ -703,6 +703,9 @@
 
 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 @@
 // -->
 // 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 @@
 // -->
 // %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 @@
   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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126058.430932.patch
Type: text/x-patch
Size: 1788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220520/a58b47c0/attachment.bin>


More information about the llvm-commits mailing list