[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > Looks like this causes a significant compile-time regression, but only for > ReleaseLTO-g: > https://llvm-compile-time-tracker.com/compare.php?from=1e19f0f9d92b5e9c43d53893e387341835d3d96b&to=c72a751dabff4260dcc309e48008941d51b31d21&stat=instructions:u > > I wouldn't really

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Nikita Popov via cfe-commits
nikic wrote: Looks like this causes a significant compile-time regression, but only for ReleaseLTO-g: https://llvm-compile-time-tracker.com/compare.php?from=1e19f0f9d92b5e9c43d53893e387341835d3d96b&to=c72a751dabff4260dcc309e48008941d51b31d21&stat=instructions:u I wouldn't really expect this ch

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -919,23 +1017,66 @@ bool X86LowerAMXCast::optimizeAMXCastFromPhi( return true; } +static Value *getShapeFromAMXIntrinsic(Value *Inst, unsigned ShapeIdx, + bool IsRow) { + if (!isAMXIntrinsic(Inst)) +return nullptr; + + auto *II

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Feng Zou via cfe-commits
https://github.com/fzou1 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/113532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/113532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Feng Zou via cfe-commits
https://github.com/fzou1 deleted https://github.com/llvm/llvm-project/pull/113532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang edited https://github.com/llvm/llvm-project/pull/113532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,248 @@ +/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE intrinsics -*- C++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Ap

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,248 @@ +/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE intrinsics -*- C++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Ap

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -121,12 +137,96 @@ static Instruction *getFirstNonAllocaInTheEntryBlock(Function &F) { llvm_unreachable("No terminator in the entry block!"); } -static std::pair getShape(IntrinsicInst *II, unsigned OpNo) { +class ShapeCalculator { +private: + TargetMachine *TM = nullpt

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -623,6 +623,37 @@ struct X86Operand final : public MCParsedAsmOperand { Inst.addOperand(MCOperand::createReg(Reg)); } + bool isTILEPair() const { +return Kind == Register && + X86MCRegisterClasses[X86::TILERegClassID].contains(getReg()); ---

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -34,9 +34,31 @@ class ShapeT { if (MRI) deduceImm(MRI); } + // When ShapeT has mult shapes, we only use Shapes (never use Row and Col) phoebewang wrote: Done. https://github.com/llvm/llvm-project/pull/113532 ___

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -34,9 +34,31 @@ class ShapeT { if (MRI) deduceImm(MRI); } + // When ShapeT has mult shapes, we only use Shapes (never use Row and Col) + // and ImmShapes. Due to the most case is only one shape (just simply use + // Shape.Row or Shape.Col), so here we don't me

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -16920,6 +16920,58 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, // instruction, but it will create a memset that won't be optimized away. return Builder.CreateMemSet(Ops[0], Ops[1], Ops[2], Align(1), true); } + // Corresponding to intrisics w

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-11-01 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,248 @@ +/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE intrinsics -*- C++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Ap

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -0,0 +1,248 @@ +/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE intrinsics -*- C++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Ap

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -34,9 +34,31 @@ class ShapeT { if (MRI) deduceImm(MRI); } + // When ShapeT has mult shapes, we only use Shapes (never use Row and Col) + // and ImmShapes. Due to the most case is only one shape (just simply use + // Shape.Row or Shape.Col), so here we don't me

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -623,6 +623,37 @@ struct X86Operand final : public MCParsedAsmOperand { Inst.addOperand(MCOperand::createReg(Reg)); } + bool isTILEPair() const { +return Kind == Register && + X86MCRegisterClasses[X86::TILERegClassID].contains(getReg()); ---

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -0,0 +1,248 @@ +/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE intrinsics -*- C++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Ap

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -919,23 +1017,66 @@ bool X86LowerAMXCast::optimizeAMXCastFromPhi( return true; } +static Value *getShapeFromAMXIntrinsic(Value *Inst, unsigned ShapeIdx, + bool IsRow) { + if (!isAMXIntrinsic(Inst)) +return nullptr; + + auto *II

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -34,9 +34,31 @@ class ShapeT { if (MRI) deduceImm(MRI); } + // When ShapeT has mult shapes, we only use Shapes (never use Row and Col) fzou1 wrote: mult -> multiple https://github.com/llvm/llvm-project/pull/113532 _

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -121,12 +137,96 @@ static Instruction *getFirstNonAllocaInTheEntryBlock(Function &F) { llvm_unreachable("No terminator in the entry block!"); } -static std::pair getShape(IntrinsicInst *II, unsigned OpNo) { +class ShapeCalculator { +private: + TargetMachine *TM = nullpt

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -16920,6 +16920,58 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, // instruction, but it will create a memset that won't be optimized away. return Builder.CreateMemSet(Ops[0], Ops[1], Ops[2], Align(1), true); } + // Corresponding to intrisics w

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -0,0 +1,248 @@ +/* ===--- amxtransposeintrin.h - AMX_TRANSPOSE intrinsics -*- C++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Ap

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-31 Thread Feng Zou via cfe-commits
@@ -80,28 +80,41 @@ INITIALIZE_PASS_BEGIN(X86FastTileConfig, DEBUG_TYPE, INITIALIZE_PASS_END(X86FastTileConfig, DEBUG_TYPE, "Fast Tile Register Configure", false, false) -static bool isTileDef(MachineRegisterInfo *MRI, MachineInstr &MI) { +static unsigned g

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-29 Thread Phoebe Wang via cfe-commits
@@ -80,28 +80,41 @@ INITIALIZE_PASS_BEGIN(X86FastTileConfig, DEBUG_TYPE, INITIALIZE_PASS_END(X86FastTileConfig, DEBUG_TYPE, "Fast Tile Register Configure", false, false) -static bool isTileDef(MachineRegisterInfo *MRI, MachineInstr &MI) { +static unsigned g

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-29 Thread Phoebe Wang via cfe-commits
@@ -34,9 +34,31 @@ class ShapeT { if (MRI) deduceImm(MRI); } + // When ShapeT has mult shapes, we only use Shapes (never use Row and Col) + // and ImmShapes. Due to the most case is only one shape (just simply use + // Shape.Row or Shape.Col), so here we don't me

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-29 Thread Phoebe Wang via cfe-commits
@@ -568,6 +568,131 @@ bool X86ExpandPseudo::expandMI(MachineBasicBlock &MBB, MI.setDesc(TII->get(Opc)); return true; } + // TILEPAIRLOAD is just for TILEPair spill, we don't have corresponding + // AMX instruction to support it. So, split it to 2 load instructions:

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-28 Thread Feng Zou via cfe-commits
@@ -568,6 +568,131 @@ bool X86ExpandPseudo::expandMI(MachineBasicBlock &MBB, MI.setDesc(TII->get(Opc)); return true; } + // TILEPAIRLOAD is just for TILEPair spill, we don't have corresponding + // AMX instruction to support it. So, split it to 2 load instructions:

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-28 Thread Feng Zou via cfe-commits
@@ -80,28 +80,41 @@ INITIALIZE_PASS_BEGIN(X86FastTileConfig, DEBUG_TYPE, INITIALIZE_PASS_END(X86FastTileConfig, DEBUG_TYPE, "Fast Tile Register Configure", false, false) -static bool isTileDef(MachineRegisterInfo *MRI, MachineInstr &MI) { +static unsigned g

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-28 Thread Feng Zou via cfe-commits
@@ -34,9 +34,31 @@ class ShapeT { if (MRI) deduceImm(MRI); } + // When ShapeT has mult shapes, we only use Shapes (never use Row and Col) + // and ImmShapes. Due to the most case is only one shape (just simply use + // Shape.Row or Shape.Col), so here we don't me

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mc Author: Phoebe Wang (phoebewang) Changes Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368 --- Patch is 184.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/113532.diff 57 Files Affected: - (modi

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Phoebe Wang (phoebewang) Changes Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368 --- Patch is 184.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/113532.diff 57 Files Affected: -

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-tablegen Author: Phoebe Wang (phoebewang) Changes Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368 --- Patch is 184.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/113532.diff 57 Files Affected: -

[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

2024-10-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Phoebe Wang (phoebewang) Changes Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368 --- Patch is 184.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/113