In D159368#4650924, @michaelmaitland wrote:In D159368#4650810, @wangpc wrote:Ping.
Do we agree to do this?I think so. My last comment expresses that there may be some lost opportunity since less instructions hasSEWOp now. The diff in this patch shows that we bail out of some optimizations when !hasSEWOp. I am concerned that the SEW operand we remove from the instructions in this patch may lead to bailing out early, when we still have SEW information. I think we could be doing hasSEWOp() || hasSEWInPseudoName() to guard these optimizations and add something like getSEWFromPseudoName(). WDYT?
Please use GitHub pull requests for new patches. Phabricator shutdown timeline
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Feed Advanced Search
Advanced Search
Advanced Search
Wed, Sep 27
Wed, Sep 27
[TableGen] Format !range doc
Mon, Sep 25
Mon, Sep 25
Ping.
Do we agree to do this?
wangpc committed rG6fc8667d05bb: [TableGen] Add tests to show wrong bits output in GenericTable (authored by wangpc).
[TableGen] Add tests to show wrong bits output in GenericTable
Tue, Sep 19
Tue, Sep 19
[RISCV] Add tests for memory constraint A
Remove nonnull and inbounds.
Mon, Sep 18
Mon, Sep 18
- Rebase.
- Don't optimize for constraint A.
Sun, Sep 17
Sun, Sep 17
- Rebase.
- Address comments.
- Add ReleaseNotes.
wangpc committed rGcedf2ea7b50f: [RISCV] Teach RISCVMergeBaseOffset to handle BlockAddress (authored by wangpc).
[RISCV] Teach RISCVMergeBaseOffset to handle BlockAddress
wangpc committed rG28efe4d38ece: [RISCV] Add tests for merging base offset of BlockAddress (authored by wangpc).
[RISCV] Add tests for merging base offset of BlockAddress
Mon, Sep 11
Mon, Sep 11
We may not need this.
Ping.
Ping.
Thu, Sep 7
Thu, Sep 7
wangpc committed rGb0ea2790c41d: [ASTImport]CXXBoolLiteralExpr should be handled explicitly in statement… (authored by jcsxky).
[ASTImport]CXXBoolLiteralExpr should be handled explicitly in statement…
Wed, Sep 6
Wed, Sep 6
wangpc updated the diff for D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
Rename sew_div_8 to sewDividedBy8.
In D159368#4638327, @michaelmaitland wrote:I wonder if it would be a good idea to add a function getSEW(MachineInstr) which gets the SEW from the Opcode or from the Operand, depending on how the pseudo tracks SEW. This indirection would remove the complication of having inconsistent pseudos. WDYT?
wangpc updated the summary of D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
wangpc updated the diff for D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
Rebase and do some refactors.
Tue, Sep 5
Tue, Sep 5
LGTM.
wangpc retitled D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos from [WIP][RISCV] Remove SEW operand for SEW-aware pseudos to [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
wangpc updated the diff for D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
Resolved all issues.
Mon, Sep 4
Mon, Sep 4
Closed as I want to use this patch to be familiar with Github workflow(https://github.com/llvm/llvm-project/pull/65292).
Thanks all!
wangpc added a comment to D158568: [TableGen] Rename ResourceCycles and StartAtCycle to clarify semantics.
In D158568#4636688, @fpetrogalli wrote:In D158568#4623906, @wangpc wrote:Is there any example show how AcquireAtCycles can be used to model scheduling? It's all 0s by default? I don't really understand how it works. :-)
You can watch the talk that describes what StartAtCycle (which became AcquireAtCycle) is for: https://www.youtube.com/watch?v=XWBVLcdzmFg
Sep 2 2023
Sep 2 2023
In D70401#4635875, @koute wrote:I know that there are still open issues regarding the psABI, but considering how slow it's been going, couldn't we merge this in anyway and mark it as experimental and subject to change? Please?
The patch is simple enough to not become a maintenance burden, and GCC already has it even though the ABI's unfinished, and the RV32E target itself is most likely going to be used for standalone bare metal programs where the exact ABI shouldn't matter too much as long as it works.
I'm asking because I'd really like to have this merged so that I could use Rust to target RV32E/RV64E. Right now I have to maintain my own toolchain, which is painful; if this got merged (even in an experimental fashion, like GCC has) I could just get upstream Rust to support it out-of-box.
Sep 1 2023
Sep 1 2023
In D159333#4634877, @craig.topper wrote:In D159333#4634843, @wangpc wrote:In D159333#4634580, @craig.topper wrote:In D159333#4634476, @wangpc wrote:In D159333#4633456, @craig.topper wrote:In D159333#4633394, @wangpc wrote:In D159333#4633363, @craig.topper wrote:In D159333#4633354, @wangpc wrote:In D159333#4633304, @michaelmaitland wrote:It looks like the InversePseudo table was only included for MCA directory. I wonder if this led to it only being a part of the llvm-mca binary, and not part of tools that do not depend on llvm-mca (such as llc). Could you check this by comparing the size of llc binary? It should have gotten larger after this change if it had not previously included the InversePseudo table.
Yes, the size will increase about 100KB for llc.
My intention is to unify the table (and make the code more consistent?). And if we can get SEW of pseudos from this table, then we don't need to specify the explict SEW imm in pseudos' operands (WIP).
For example:class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$sew, ixlenimm:$policy), []>becomes:
class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$policy), []>,This may simplify the generated patterns I think.
Won't that require adding more pseudos for each SEW. Many pseudos don't have SEW today.
I think almost all pseudos has HasSEWOp being true?
Edit: I get it. I won't add more pseduos, but remove the SEW operand for existed pseudos.So there will 2 kinds of pseudos? Those with SEW in their name and those with an SEW operand?
Yes.
I just tried, if we remove the SEW operand of SEW-aware pseudos (load/store instructions are excluded in my experiment currently) operands and search SEW by RISCVVPseudosTable, we can reduce 30K of llc's text section and about 6000 lines of RISCVGenDAGISel.inc. But it will also add some complexities and make the RVV pseudos inconsistent.
I may post the patch after more investigations next week.Posted in D159368.
Where does the 30K text section reduction come from? What code are we reducing?
There should be a comment in RISCVGenDAGISel.inc that says "Total Array size is" can give the reduction on that value. That's more interesting than lines.
Because we don't need to match and add SEW operand, the size of MatcherTable can be reduced by about 23000 bytes, I think most of the reduction comes from here. RISCVGenInstrInfo has some reductions too.
My proposal is removing SEW operand of load/store instructions and SEW-aware instrucitons like reductions, div, sqrt, etc. And the SEW value can searched by RISCVVPseudosTable (or, we can encode it in TSFlags like LMUL by using 2bits).Is the matcher table in the .text section?
wangpc updated the summary of D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
In D159333#4634580, @craig.topper wrote:In D159333#4634476, @wangpc wrote:In D159333#4633456, @craig.topper wrote:In D159333#4633394, @wangpc wrote:In D159333#4633363, @craig.topper wrote:In D159333#4633354, @wangpc wrote:In D159333#4633304, @michaelmaitland wrote:It looks like the InversePseudo table was only included for MCA directory. I wonder if this led to it only being a part of the llvm-mca binary, and not part of tools that do not depend on llvm-mca (such as llc). Could you check this by comparing the size of llc binary? It should have gotten larger after this change if it had not previously included the InversePseudo table.
Yes, the size will increase about 100KB for llc.
My intention is to unify the table (and make the code more consistent?). And if we can get SEW of pseudos from this table, then we don't need to specify the explict SEW imm in pseudos' operands (WIP).
For example:class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$sew, ixlenimm:$policy), []>becomes:
class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$policy), []>,This may simplify the generated patterns I think.
Won't that require adding more pseudos for each SEW. Many pseudos don't have SEW today.
I think almost all pseudos has HasSEWOp being true?
Edit: I get it. I won't add more pseduos, but remove the SEW operand for existed pseudos.So there will 2 kinds of pseudos? Those with SEW in their name and those with an SEW operand?
Yes.
I just tried, if we remove the SEW operand of SEW-aware pseudos (load/store instructions are excluded in my experiment currently) operands and search SEW by RISCVVPseudosTable, we can reduce 30K of llc's text section and about 6000 lines of RISCVGenDAGISel.inc. But it will also add some complexities and make the RVV pseudos inconsistent.
I may post the patch after more investigations next week.
Posted in D159368.
Where does the 30K text section reduction come from? What code are we reducing?
There should be a comment in RISCVGenDAGISel.inc that says "Total Array size is" can give the reduction on that value. That's more interesting than lines.
Because we don't need to match and add SEW operand, the size of MatcherTable can be reduced by about 23000 bytes, I think most of the reduction comes from here. RISCVGenInstrInfo has some reductions too.
My proposal is removing SEW operand of load/store instructions and SEW-aware instrucitons like reductions, div, sqrt, etc. And the SEW value can be searched by RISCVVPseudosTable (or, we can encode it in TSFlags like LMUL by using 2bits).
wangpc requested review of D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos.
In D159333#4633456, @craig.topper wrote:In D159333#4633394, @wangpc wrote:In D159333#4633363, @craig.topper wrote:In D159333#4633354, @wangpc wrote:In D159333#4633304, @michaelmaitland wrote:It looks like the InversePseudo table was only included for MCA directory. I wonder if this led to it only being a part of the llvm-mca binary, and not part of tools that do not depend on llvm-mca (such as llc). Could you check this by comparing the size of llc binary? It should have gotten larger after this change if it had not previously included the InversePseudo table.
Yes, the size will increase about 100KB for llc.
My intention is to unify the table (and make the code more consistent?). And if we can get SEW of pseudos from this table, then we don't need to specify the explict SEW imm in pseudos' operands (WIP).
For example:class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$sew, ixlenimm:$policy), []>becomes:
class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$policy), []>,This may simplify the generated patterns I think.
Won't that require adding more pseudos for each SEW. Many pseudos don't have SEW today.
I think almost all pseudos has HasSEWOp being true?
Edit: I get it. I won't add more pseduos, but remove the SEW operand for existed pseudos.So there will 2 kinds of pseudos? Those with SEW in their name and those with an SEW operand?
Aug 31 2023
Aug 31 2023
In D159333#4633363, @craig.topper wrote:In D159333#4633354, @wangpc wrote:In D159333#4633304, @michaelmaitland wrote:It looks like the InversePseudo table was only included for MCA directory. I wonder if this led to it only being a part of the llvm-mca binary, and not part of tools that do not depend on llvm-mca (such as llc). Could you check this by comparing the size of llc binary? It should have gotten larger after this change if it had not previously included the InversePseudo table.
Yes, the size will increase about 100KB for llc.
My intention is to unify the table (and make the code more consistent?). And if we can get SEW of pseudos from this table, then we don't need to specify the explict SEW imm in pseudos' operands (WIP).
For example:class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$sew, ixlenimm:$policy), []>becomes:
class VPseudoUSLoadNoMask<VReg RetClass, int EEW> : Pseudo<(outs RetClass:$rd), (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$policy), []>,This may simplify the generated patterns I think.
Won't that require adding more pseudos for each SEW. Many pseudos don't have SEW today.
In D159333#4633304, @michaelmaitland wrote:It looks like the InversePseudo table was only included for MCA directory. I wonder if this led to it only being a part of the llvm-mca binary, and not part of tools that do not depend on llvm-mca (such as llc). Could you check this by comparing the size of llc binary? It should have gotten larger after this change if it had not previously included the InversePseudo table.
[RISCV][NFC] Remove _TU in PseudoToVInst
wangpc retitled D159301: [RISCV][llvm-mca] Fix getLMUL values from [RISCV][llvm-mca] Fix Fix getLMUL values to [RISCV][llvm-mca] Fix getLMUL values.
LGTM, it seems reasonable to me, but please wait for @craig.topper to see if there are more comments.
wangpc accepted D159253: [RISCV] Teach MatInt to use (ADD_UW X, (SLLI X, 32)) to materialize some constants..
It seems reasonable to me.
LGTM.
wangpc committed rGf281543a4890: [RISCV] Teach RISCVMergeBaseOffset to handle inline asm (authored by wangpc).
[RISCV] Teach RISCVMergeBaseOffset to handle inline asm
[RISCV] Precommit test for D158062
Aug 30 2023
Aug 30 2023
Ping. Is it OK now?
wangpc accepted D159231: [RISCV] Set SEW on VPseudoTernaryWithTailPolicy and VPseudoTernaryWithTailPolicyRoundingMode.
LGTM.
I was thinking about adding v1i256, v1i512, etc. Is it feasible?
LGTM.
wangpc added inline comments to D158492: [RISCV] Add CSR RegisterClass and save/restore fcsr in interrupt.
Aug 29 2023
Aug 29 2023
wangpc added inline comments to D159145: [RISCV] Don't add -unaligned-scalar-mem to target features by default..
wangpc added inline comments to D159145: [RISCV] Don't add -unaligned-scalar-mem to target features by default..
LGTM.
In D112921#4624674, @aaron.ballman wrote:Because the issues have been ongoing for a few hours now, I think it'd make sense to revert these changes while trying to determine what the appropriate fix is. @wangpc would you mind doing the revert?
Aug 29 2023, 6:34 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
In D112921#4624141, @nikic wrote:FYI this resulted in some pretty wild code size swings, in particular between -10% and -15% for tramp3d-v4 (http://llvm-compile-time-tracker.com/compare.php?from=6cde64a94986165547ae5237ac7dd4bddfc9f2a7&to=2916b125f686115deab2ba573dcaff3847566ab9&stat=size-text). Not sure whether that's an expected result of this change or not.
Aug 29 2023, 5:46 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
In D112921#4624547, @jhuber6 wrote:This caused some linking errors with the GPU libc test suite, see https://lab.llvm.org/staging/#/builders/247/builds/5659.
clang++: error: ld.lld command failed with exit code 1 (use -v to see invocation) [331/473] Linking CXX executable libc/test/src/__support/libc.test.src.__support.uint_test.__hermetic__.__build__ FAILED: libc/test/src/__support/libc.test.src.__support.uint_test.__hermetic__.__build__ : && /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ --target=x86_64-unknown-linux-gnu -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,--color-diagnostics -nostdlib -static libc/startup/gpu/amdgpu/CMakeFiles/libc.startup.gpu.amdgpu.crt1.dir/start.cpp.o libc/test/src/__support/CMakeFiles/libc.test.src.__support.uint_test.__hermetic__.__build__.dir/uint_test.cpp.o -o libc/test/src/__support/libc.test.src.__support.uint_test.__hermetic__.__build__ libc/test/UnitTest/libLibcTest.hermetic.a libc/test/UnitTest/libLibcHermeticTestSupport.hermetic.a libc/test/src/__support/liblibc.test.src.__support.uint_test.__hermetic__.libc.a -mcpu=gfx906 --target=amdgcn-amd-amdhsa -flto -Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0 && : ld.lld: error: undefined symbol: operator delete(void*, unsigned long) >>> referenced by lto.tmp:(LlvmLibcUIntClassTest_ConstructorFromUInt128Tests::~LlvmLibcUIntClassTest_ConstructorFromUInt128Tests()) >>> referenced by lto.tmp:(LlvmLibcUIntClassTest_ConstructorFromUInt128Tests::~LlvmLibcUIntClassTest_ConstructorFromUInt128Tests()) >>> referenced by lto.tmp:(LlvmLibcUIntClassTest_BasicArithmeticInt128Tests::~LlvmLibcUIntClassTest_BasicArithmeticInt128Tests()) >>> referenced 41 more times >>> did you mean: operator delete(void*) >>> defined in: lto.tmp clang++: error: ld.lld command failed with exit code 1 (use -v to see invocation)
Aug 29 2023, 5:39 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
In D112921#4624488, @thakis wrote:Looks like this breaks tests on windows: http://45.33.8.238/win/83485/step_7.txt
Please take a look and revert for now if it takes a while to fix.
(Also, if the patch doesn't already do it, it probably shouldn't change defaults in clang-cl mode?)
Aug 29 2023, 5:32 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
wangpc committed rG8c6d8381ea2f: [RISCV] Add isCommutable for pseudos without merge operand (authored by wangpc).
[RISCV] Add isCommutable for pseudos without merge operand
wangpc committed rG2916b125f686: [clang] Enable sized deallocation by default in C++14 onwards (authored by wangpc).
[clang] Enable sized deallocation by default in C++14 onwards
Aug 29 2023, 12:43 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
Aug 29 2023, 12:43 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
Thanks all! I will land this patch later.
If there are some failures (especially libcxx part @Mordante :-) ), please help me to fix them. Thanks in advance!
Aug 29 2023, 12:42 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
Rebase.
Aug 29 2023, 12:05 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
Aug 28 2023
Aug 28 2023
wangpc added a comment to D158568: [TableGen] Rename ResourceCycles and StartAtCycle to clarify semantics.
Is there any example show how AcquireAtCycles can be used to model scheduling? It's all 0s by default? I don't really understand how it works. :-)
wangpc added inline comments to D112921: [clang] Enable sized deallocation by default in C++14 onwards.
Aug 28 2023, 8:48 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
wangpc added inline comments to D158976: [RISCV] Add isCommutable for pseudos without merge operand.
Exclude PseudoVMANDN and PseudoVMORN.
wangpc accepted D159029: [RISCV] Correct scheduling information for WriteVIRedMinMaxV in RISCVSchedSiFive7.td..
LGTM.
wangpc added a comment to D158492: [RISCV] Add CSR RegisterClass and save/restore fcsr in interrupt.
Gentle ping. :-)
wangpc added a comment to D159029: [RISCV] Correct scheduling information for WriteVIRedMinMaxV in RISCVSchedSiFive7.td..
I remember that the reasom why we added separate Scheds for min/max reductions is that your downstream needs to give different scheduling for min/max from other reductions in D155108.
Is it right for this processor?
In D158976#4621291, @michaelmaitland wrote:I'm not very familiar with how isCommutable works, but this change looks like a good idea as long as isCommutable only refers to the $rs2 and $rs1 operands, and does not say anything about commutability of $carry, $vl, or $sew.
In D112921#4621019, @aaron.ballman wrote:In D112921#4620399, @wangpc wrote:Gentle ping. Can I move forward and land this?
What name and email address would you like us to use for patch attribution?
Thanks! I have commit access.
Aug 28 2023, 5:38 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
wangpc added inline comments to D158956: [RISCV] Initial ISel support for the experimental zacas extension.
Aug 27 2023
Aug 27 2023
Gentle ping. Can I move forward and land this?
Aug 27 2023, 9:08 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project
Aug 25 2023
Aug 25 2023
FYI: I think D157694 is related.
Aug 24 2023
Aug 24 2023
Rebase and address comments.
Rebase.
Aug 23 2023
Aug 23 2023
[RISCV] Fix assertion of getShuffleCost
Ping.