[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-17 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added a comment. The fix is uploaded at https://reviews.llvm.org/D98773. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 ___ cfe-commits mailing list cf

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-16 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added a comment. I can reproduce the regression. I'll help to fix it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 ___ cfe-commits mailing list cfe-c

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-16 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. @yubing In this case I would recommend building `sqlite3.c` from test-suite under `perf stat` and look at the `instructions` metric. For me the command looks like this: perf stat CLANG_BINARY -w -Werror=date-time -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-16 Thread Bing Yu via Phabricator via cfe-commits
yubing added a comment. In D93594#2628497 , @nikic wrote: > It looks like this has caused a compile-time regression at `O0`: > https://llvm-compile-time-tracker.com/compare.php?from=9341bcbdc93a251b632ffaa51a84452a7a4a5e4e&to=4f198b0c27b04e830a3069aaf4b39

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-16 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. It looks like this has caused a compile-time regression at `O0`: https://llvm-compile-time-tracker.com/compare.php?from=9341bcbdc93a251b632ffaa51a84452a7a4a5e4e&to=4f198b0c27b04e830a3069aaf4b39cf203eaae4a&stat=instructions The cause is probably the computation of DomTree a

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-15 Thread Bing Yu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4f198b0c27b0: [X86] Pass to transform amx intrinsics to scalar operation. (authored by yubing). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-08 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 329204. yubing added a comment. Fix buildfail when it is -DBUILD_SHARED_LIBS=ON Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/llvm/CodeGen/Passes

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-08 Thread Bing Yu via Phabricator via cfe-commits
yubing added a comment. In D93594#2606157 , @RKSimon wrote: > @yubing I've reverted this as it was failing on a lot of buildbots: > http://lab.llvm.org:8011/#/builders/109/builds/9867 Hi, @RKSimon @nicolasvasilache , it seems we haven't told libLLVMX86C

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-06 Thread Bing Yu via Phabricator via cfe-commits
yubing added a comment. Thanks all for reporting and reverting this. I will do bugfix asap. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 ___ cfe-commits mailin

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-05 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Thanks all for reporting and reverting this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-05 Thread David Zarzycki via Phabricator via cfe-commits
davezarzycki added a comment. In D93594#2606157 , @RKSimon wrote: > @yubing I've reverted this as it was failing on a lot of buildbots: > http://lab.llvm.org:8011/#/builders/109/builds/9867 Thanks – I was just about to point out this broke downstream tes

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-05 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment. @yubing I've reverted this as it was failing on a lot of buildbots: http://lab.llvm.org:8011/#/builders/109/builds/9867 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-05 Thread Nicolas Vasilache via Phabricator via cfe-commits
nicolasvasilache added a comment. This seems to break the build https://buildkite.com/mlir/mlir-core/builds/12026#91ec4dfe-542f-4312-92db-7d555f05ce06. I could repro locally, reverting locally fixes the build. Please address, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-05 Thread Bing Yu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8198d83965ba: [X86] Pass to transform amx intrinsics to scalar operation. (authored by LuoYuanke, committed by yubing). Changed prior to commit: h

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-04 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added a comment. LGTM too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-04 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 328408. yubing added a comment. Address pengfei's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/llvm/CodeGen/Passes.h llvm/lib/Target/

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-04 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:82 + DTU.applyUpdatesPermissive({ + {DominatorTree::Delete, Preheader, Tmp}, + {DominatorTree::Insert, Header, Body}, pengfei wrote: > Do we need to remove the s

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-03 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM with some nitpicks 😊 Comment at: llvm/include/llvm/CodeGen/Passes.h:496 + + /// The pass transform amx intrinsics to scalar operation if the function has + /// optno

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-02 Thread Bing Yu via Phabricator via cfe-commits
yubing added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:311 + Value *ResElt = B.CreateAdd(EltC, SubVecR); + Value *NewVecC = B.CreateInsertElement(VecCPhi, ResElt, IdxC); + Value *NewVecD = B.CreateInsertElement(VecDPhi, ResElt, IdxC); -

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-02 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:311 + Value *ResElt = B.CreateAdd(EltC, SubVecR); + Value *NewVecC = B.CreateInsertElement(VecCPhi, ResElt, IdxC); + Value *NewVecD = B.CreateInsertElement(VecDPhi, ResElt, IdxC); --

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-01 Thread Bing Yu via Phabricator via cfe-commits
yubing marked 15 inline comments as done. yubing added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:311 + Value *ResElt = B.CreateAdd(EltC, SubVecR); + Value *NewVecC = B.CreateInsertElement(VecCPhi, ResElt, IdxC); + Value *NewVecD = B.CreateInser

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-03-01 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 327362. yubing edited the summary of this revision. yubing added a comment. address comments above Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-28 Thread Bing Yu via Phabricator via cfe-commits
yubing added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:99 + Loop *RowLoop = LI.AllocateLoop(); + Loop *ColLoop = LI.AllocateLoop(); + RowLoop->addChildLoop(ColLoop); pengfei wrote: > Not sure how about the arithmetic intrinsics

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-27 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:88 + +template LuoYuanke wrote: > > pengfei wrote: > > > Can we just use `template `? I think it also can reduce the > > > branch. > > Why do we need a template instead of passing a param

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-27 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:88 + +template pengfei wrote: > > Can we just use `template `? I think it also can reduce the > > branch. > Why do we need a template instead of passing a parameter `bool IsLoad`? Bing thou

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-27 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:88 + +template Can we just use `template `? I think it also can reduce the > branch. Why do we need a template instead of passing a parameter `bool IsLoad`? Repository: rG LLVM Github

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-24 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:311 + Value *ResElt = B.CreateAdd(EltC, SubVecR); + Value *NewVecC = B.CreateInsertElement(VecCPhi, ResElt, IdxC); + Value *NewVecD = B.CreateInsertElement(VecDPhi, ResElt, IdxC);

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-24 Thread Bing Yu via Phabricator via cfe-commits
yubing added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:311 + Value *ResElt = B.CreateAdd(EltC, SubVecR); + Value *NewVecC = B.CreateInsertElement(VecCPhi, ResElt, IdxC); + Value *NewVecD = B.CreateInsertElement(VecDPhi, ResElt, IdxC); -

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-24 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/include/llvm/CodeGen/Passes.h:496 + + /// The pass transform amx intrinsics to scalar operation if the function has + /// optnone attribute or it is O0. transforms Comment at: llvm/lib/Target/X8

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-23 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 325964. yubing added a comment. Fix some comments and commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/llvm/CodeGen/Passes.h llvm/l

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-22 Thread Bing Yu via Phabricator via cfe-commits
yubing marked 13 inline comments as done. yubing added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:487 + SmallVector WorkList; + for (BasicBlock *BB : depth_first(&Func)) { +for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE;

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-22 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 325670. yubing added a comment. Address comments above Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/llvm/CodeGen/Passes.h llvm/lib/Target/X86/

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-21 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:490 + Instruction &Inst = *II++; + if (match(&Inst, m_Intrinsic()) || + match(&Inst, m_Intrinsic()) || Should be better to use ``` if (auto *Inst = dyn_ca

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-20 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added inline comments. Comment at: llvm/include/llvm/CodeGen/Passes.h:496 + + FunctionPass *createX86LowerAMXIntrinsicsPass(); } // End llvm namespace Add comments to describe what the pass does? Comment at: llvm/lib/Target/X86/X86L

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-19 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 325155. yubing marked 5 inline comments as done. yubing added a comment. Small fix for some code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/ll

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-19 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 325152. yubing added a comment. Address the commments above. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/llvm/CodeGen/Passes.h llvm/lib/Targe

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-19 Thread Bing Yu via Phabricator via cfe-commits
yubing added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:211-212 +IRBuilderBase &B, DomTreeUpdater &DTU, +LoopInfo &LI, Value *Row, Value *Col, +

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-09 Thread Xiang Zhang via Phabricator via cfe-commits
xiangzhangllvm added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:211-212 +IRBuilderBase &B, DomTreeUpdater &DTU, +LoopInfo &LI, Value *Row, Value *Col, +

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-09 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added inline comments. Comment at: llvm/lib/Target/X86/X86TargetMachine.cpp:416 + if (TM->getOptLevel() == CodeGenOpt::None) +addPass(createX86LowerAMXIntrinsicsPass()); + else { We may add both pass anyway and skip the pass based on the option le

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:433 +bool X86LowerAMXIntrinsics::visit() { + bool C; + SmallVector TileDPBSSDs; `bool C = false` Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cp

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-09 Thread Xiang Zhang via Phabricator via cfe-commits
xiangzhangllvm added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:356 + I->eraseFromParent(); +} + } I see you need force match bitcast then replace, add assert for no bitcast case Comment at: llvm/lib/Ta

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-08 Thread Bing Yu via Phabricator via cfe-commits
yubing added inline comments. Comment at: llvm/test/CodeGen/X86/AMX/amx-low-intrinsics.ll:77 +; CHECK-NEXT:[[TILEDPBSSD_UNROLL_ROWS_IV:%.*]] = phi i16 [ 0, [[ENTRY:%.*]] ], [ [[TILEDPBSSD_UNROLL_ROWS_STEP:%.*]], [[TILEDPBSSD_UNROLL_ROWS_LATCH:%.*]] ] +; CHECK-NEXT:[[VEC

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-05 Thread Bing Yu via Phabricator via cfe-commits
yubing added a comment. Strange. llvm/test/CodeGen/X86/AMX/amx-low-intrinsics.ll can pass in my local machine. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 __

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-05 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 321673. yubing added a comment. Rebase and fix the bug in amx_api.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 Files: llvm/include/llvm/CodeGen/Passes.h llvm/li

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-05 Thread LuoYuanke via Phabricator via cfe-commits
LuoYuanke added a comment. Would you rebase to see if the lit test failure is related to this patch? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93594/new/ https://reviews.llvm.org/D93594 ___ cfe-commi

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-01-28 Thread Bing Yu via Phabricator via cfe-commits
yubing updated this revision to Diff 319797. yubing added a comment. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fix some bugs in lowerTileDPBSSD, lowerTileStore, lowerTileLoad Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/