Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

anhtuyen (Anh Tuyen Tran)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 8 2018, 8:35 AM (265 w, 2 d)

Recent Activity

Oct 14 2021

anhtuyen accepted D111807: [NFC][compiler-rt][profile] Remove non-Posix -h option from test.

LGTM

Oct 14 2021, 7:50 AM · Restricted Project

Jul 3 2021

anhtuyen added a comment to D99696: [clang] NRVO: Improvements and handling of more cases..

@anhtuyen

I pushed a DR with a preliminary fix for it: https://reviews.llvm.org/D105380

This is not ready to merge, still have to add test cases and also decide between a pointed fix like this, or improving the ergonomics of getDeclAlign by returning possible failure.

But it does fix your repro.

Jul 3 2021, 8:13 PM · Restricted Project

Jul 2 2021

anhtuyen added a comment to D99696: [clang] NRVO: Improvements and handling of more cases..

Hi Matheus @mizvekov,
The commit 12c90e2e25dfd1d38250055efc21acb42d158912 from this patch seems to cause a regression, where an assertion failure starts to occur with testcases such as

Jul 2 2021, 3:08 PM · Restricted Project

Nov 21 2020

anhtuyen abandoned D91907: Add missing dependencies, which caused link failure when building with -DBUILD_SHARED_LIBS:BOOL=ON.

The error only occurs when I have more code in my local. I close it now.

Nov 21 2020, 7:22 AM · Restricted Project
anhtuyen added a comment to D91907: Add missing dependencies, which caused link failure when building with -DBUILD_SHARED_LIBS:BOOL=ON.

Curious enough, I can't reproduce this failure.

Nov 21 2020, 7:19 AM · Restricted Project
anhtuyen updated the summary of D91907: Add missing dependencies, which caused link failure when building with -DBUILD_SHARED_LIBS:BOOL=ON.
Nov 21 2020, 7:17 AM · Restricted Project

Nov 20 2020

anhtuyen updated the summary of D91907: Add missing dependencies, which caused link failure when building with -DBUILD_SHARED_LIBS:BOOL=ON.
Nov 20 2020, 10:19 PM · Restricted Project
anhtuyen updated the summary of D91907: Add missing dependencies, which caused link failure when building with -DBUILD_SHARED_LIBS:BOOL=ON.
Nov 20 2020, 10:18 PM · Restricted Project
anhtuyen requested review of D91907: Add missing dependencies, which caused link failure when building with -DBUILD_SHARED_LIBS:BOOL=ON.
Nov 20 2020, 9:48 PM · Restricted Project

Nov 12 2020

anhtuyen committed rG5f672fefeb26: Reland: Introduce -dot-cfg-mssa option which creates dot-cfg style file with… (authored by jamieschmeiser).
Reland: Introduce -dot-cfg-mssa option which creates dot-cfg style file with…
Nov 12 2020, 9:39 AM
anhtuyen closed D90638: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source.
Nov 12 2020, 9:39 AM · Restricted Project
anhtuyen reopened D90638: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source.

Reopen due to a failed build on builder polly-x86_64-linux
Full details are available at:

https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_-23builders_10_builds_615&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=Nr2SnYQn80wzIpml4veK2C-U4ilVZzi0kWYCc2WSLoA&m=CQgGRYR_3xNbiZpMevJ_fOqMziVnPdj-Qa8sJXA1NHQ&s=2jJHm84n7dRHKQQ9ax_D-LQiQ6lf_9ypNbnuph-cCAs&e=

Buildbot URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=Nr2SnYQn80wzIpml4veK2C-U4ilVZzi0kWYCc2WSLoA&m=CQgGRYR_3xNbiZpMevJ_fOqMziVnPdj-Qa8sJXA1NHQ&s=JFUUxRP6j5j0BPDw9yCc6lMViVmJFWrmcTQN13xbtEE&e=
Worker for this Build: polly-x86_64-gce1

Nov 12 2020, 7:53 AM · Restricted Project
anhtuyen added a reverting change for rG45d459e7522d: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa…: rGa20b3620bb7c: Revert "Introduce -dot-cfg-mssa option which creates dot-cfg style file with….
Nov 12 2020, 7:49 AM
anhtuyen committed rGa20b3620bb7c: Revert "Introduce -dot-cfg-mssa option which creates dot-cfg style file with… (authored by anhtuyen).
Revert "Introduce -dot-cfg-mssa option which creates dot-cfg style file with…
Nov 12 2020, 7:49 AM
anhtuyen added a reverting change for D90638: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source: rGa20b3620bb7c: Revert "Introduce -dot-cfg-mssa option which creates dot-cfg style file with….
Nov 12 2020, 7:49 AM · Restricted Project
anhtuyen committed rG45d459e7522d: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa… (authored by jamieschmeiser).
Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa…
Nov 12 2020, 7:41 AM
anhtuyen closed D90638: Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source.
Nov 12 2020, 7:41 AM · Restricted Project
anhtuyen committed rG782d6a6963c1: Introduce -print-before-changed, making -print-changed also print before passes… (authored by jamieschmeiser).
Introduce -print-before-changed, making -print-changed also print before passes…
Nov 12 2020, 7:21 AM
anhtuyen closed D88757: Introduce -print-before-changed, making -print-changed also print before passes that modify IR.
Nov 12 2020, 7:21 AM · Restricted Project
anhtuyen committed rGf79b483385ce: [NFC intended] Refactor SinkAndHoistLICMFlags to allow others to construct… (authored by jamieschmeiser).
[NFC intended] Refactor SinkAndHoistLICMFlags to allow others to construct…
Nov 12 2020, 7:07 AM
anhtuyen closed D90482: [NFC intended] Refactor SinkAndHoistLICMFlags to allow others to construct without exposing internals.
Nov 12 2020, 7:07 AM · Restricted Project

Oct 15 2020

anhtuyen committed rG224fd6ff48e2: [NFC][CaptureTracking] Move static function isNonEscapingLocalObject to llvm… (authored by anhtuyen).
[NFC][CaptureTracking] Move static function isNonEscapingLocalObject to llvm…
Oct 15 2020, 11:37 AM
anhtuyen closed D89465: [NFC][CaptureTracking] Move static function isNonEscapingLocalObject to llvm namespace so that it can be used by other pass(es).
Oct 15 2020, 11:37 AM · Restricted Project
anhtuyen updated the diff for D89465: [NFC][CaptureTracking] Move static function isNonEscapingLocalObject to llvm namespace so that it can be used by other pass(es).

Address comment by Lint: Pre-merge checks related to clang-format

Oct 15 2020, 11:04 AM · Restricted Project
anhtuyen requested review of D89465: [NFC][CaptureTracking] Move static function isNonEscapingLocalObject to llvm namespace so that it can be used by other pass(es).
Oct 15 2020, 7:08 AM · Restricted Project

Oct 1 2020

anhtuyen committed rG71124a9dbdcc: Reland No.3: Add new hidden option -print-changed which only reports changes to… (authored by jamieschmeiser).
Reland No.3: Add new hidden option -print-changed which only reports changes to…
Oct 1 2020, 10:40 AM
anhtuyen closed D86360: Add new hidden option -print-changed which only reports changes to IR.
Oct 1 2020, 10:39 AM · Restricted Project

Sep 16 2020

anhtuyen committed rGf9e6d1edc0da: Re-land: Add new hidden option -print-changed which only reports changes to IR (authored by jamieschmeiser).
Re-land: Add new hidden option -print-changed which only reports changes to IR
Sep 16 2020, 10:25 AM
anhtuyen closed D86360: Add new hidden option -print-changed which only reports changes to IR.
Sep 16 2020, 10:25 AM · Restricted Project

Sep 3 2020

anhtuyen committed rGb2e65cf9501d: Revert "Add new hidden option -print-changed which only reports changes to IR" (authored by jamieschmeiser).
Revert "Add new hidden option -print-changed which only reports changes to IR"
Sep 3 2020, 11:42 AM
anhtuyen added a reverting change for rG7bc9924cb2fb: Add new hidden option -print-changed which only reports changes to IR: rGb2e65cf9501d: Revert "Add new hidden option -print-changed which only reports changes to IR".
Sep 3 2020, 11:42 AM
anhtuyen added a reverting change for D86360: Add new hidden option -print-changed which only reports changes to IR: rGb2e65cf9501d: Revert "Add new hidden option -print-changed which only reports changes to IR".
Sep 3 2020, 11:41 AM · Restricted Project
anhtuyen committed rG7bc9924cb2fb: Add new hidden option -print-changed which only reports changes to IR (authored by jamieschmeiser).
Add new hidden option -print-changed which only reports changes to IR
Sep 3 2020, 8:53 AM
anhtuyen closed D86360: Add new hidden option -print-changed which only reports changes to IR.
Sep 3 2020, 8:52 AM · Restricted Project

Sep 1 2020

anhtuyen committed rG68717acb24e5: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom… (authored by anhtuyen).
[LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom…
Sep 1 2020, 7:00 AM
anhtuyen closed D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.
Sep 1 2020, 7:00 AM · Restricted Project

Aug 31 2020

anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Hello @lebedev.ri
Bardia and I have provided the answer to your concerns, but we have not heard from you since last week. Please let me know what other changes, if any, that you still need to see.

Aug 31 2020, 6:54 AM · Restricted Project

Aug 28 2020

anhtuyen updated the diff for D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Update with cl::location and remove the extra - from the testcase (eg from --disable... to -disable).

Aug 28 2020, 7:18 AM · Restricted Project

Aug 25 2020

anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Bugreport: https://bugs.llvm.org/show_bug.cgi?id=47300

Aug 25 2020, 6:58 AM · Restricted Project

Aug 24 2020

anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Thanks @bmahjour for uploading a DA test case. I had difficulty coming up with a similar test myself.
To @lebedev.ri : I think the comments from @bmahjour might have answered most of your questions. If not, please list them here and I will try to address them. If you insist in having the testcases in bugreport, I will do that. It might take some time though, since I am still waiting for my password to be reset via the webtools (contacted bugs-admin).

Aug 24 2020, 11:49 AM · Restricted Project
anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Hi @lebedev.ri
I saw you had again requested changes to this revision, but I could not find what changes that you thought should be required. Can you please be specific?

Aug 24 2020, 9:52 AM · Restricted Project
anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

I removed the details about DA being confused by the insertion of memset/memcpy by LIRP in the description.

Aug 24 2020, 9:20 AM · Restricted Project
anhtuyen updated the summary of D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.
Aug 24 2020, 9:13 AM · Restricted Project
anhtuyen added inline comments to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.
Aug 24 2020, 9:08 AM · Restricted Project
anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

I'd like to see a PhaseOrdering test showing the IR that is not optimized due to the DA being unaware about these intrinsics.

Aug 24 2020, 9:05 AM · Restricted Project
anhtuyen updated the diff for D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Address comments by the reviewers.

Aug 24 2020, 8:56 AM · Restricted Project

Aug 21 2020

anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

To avoid any issue with NDA, I wrote a simple test as follows. This test program tries to prove the fact that, the impact of Loop Idiom Recognize Pass (LIGP)’s replacing store with memset is not always a positive one.

Aug 21 2020, 1:50 PM · Restricted Project

Aug 20 2020

anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

... a concrete motivating example would be helpful.

Aug 20 2020, 11:42 AM · Restricted Project
anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Why not just enhance DA?

I agree with that, it seems to be better to improve DA. Is it feasible?

I agree that DA can be improved, but I hope that the example below from @nemanjai about libraries, which are highly tuned with respect to when/whether to call memset/memcpy functions provides another reason for this proposed change.

I'm not really sold on this. We have similar transform in InstCombine.
If the original problem is with DA, then that is what should be improved.

If this transform is a pessimization for some code, it would be good to actually see that code.

I hope you find the detailed comment below by @bmahjour (thanks, @bmahjour) a reasonable ground for this change.

Aug 20 2020, 7:57 AM · Restricted Project
anhtuyen added inline comments to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.
Aug 20 2020, 7:21 AM · Restricted Project
anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Why not just enhance DA?

I agree with that, it seems to be better to improve DA. Is it feasible?

Aug 20 2020, 7:12 AM · Restricted Project
anhtuyen added a comment to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Presumably (now or in the future) there may be other places in this pass that produce memset/memcpy. Also, we will unnecessarily collect stores in in collectStores(). So it seems to me like it might be more advantageous to have these options prevent isLegalStore() from returning the corresponding store type.

Aug 20 2020, 6:51 AM · Restricted Project

Aug 19 2020

anhtuyen added inline comments to D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.
Aug 19 2020, 10:22 PM · Restricted Project
anhtuyen updated the diff for D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.

Remove an empty line based on reviewer's comment.

Aug 19 2020, 10:20 PM · Restricted Project
anhtuyen requested review of D86262: [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass.
Aug 19 2020, 9:29 PM · Restricted Project

Aug 18 2020

anhtuyen committed rG645c6856a68a: [NFC] Add raw_ostream parameter to printIR routines (authored by jamieschmeiser).
[NFC] Add raw_ostream parameter to printIR routines
Aug 18 2020, 9:06 AM
anhtuyen closed D85999: [NFC] Add raw_ostream parameter to printIR routines.
Aug 18 2020, 9:05 AM · Restricted Project

Jul 28 2020

anhtuyen committed rG8dbe9b249846: [Clang-tools-extra] Mark override a function which overrides a virtual one (authored by anhtuyen).
[Clang-tools-extra] Mark override a function which overrides a virtual one
Jul 28 2020, 10:31 PM
anhtuyen closed D84794: Mark override to a function which overrides a virtual one.
Jul 28 2020, 10:31 PM · Restricted Project, Restricted Project
anhtuyen requested review of D84794: Mark override to a function which overrides a virtual one.
Jul 28 2020, 1:14 PM · Restricted Project, Restricted Project

Jul 17 2020

anhtuyen committed rG11e879d4f111: [Loop Simplify] Resolve an issue where metadata is not applied to a loop latch. (authored by sidbav).
[Loop Simplify] Resolve an issue where metadata is not applied to a loop latch.
Jul 17 2020, 7:02 AM
anhtuyen closed D83869: [Loop Simplify] Resolve an issue where metadata is not applied to a loop latch..
Jul 17 2020, 7:02 AM · Restricted Project

Jul 10 2020

anhtuyen committed rGe541e1b75723: [NFC] Separate Peeling Properties into its own struct (re-land after minor fix) (authored by sidbav).
[NFC] Separate Peeling Properties into its own struct (re-land after minor fix)
Jul 10 2020, 11:40 AM

Jul 8 2020

anhtuyen committed rG0369dc98f958: [NFC] Separate Peeling Properties into its own struct (authored by sidbav).
[NFC] Separate Peeling Properties into its own struct
Jul 8 2020, 12:00 PM
anhtuyen committed rG6965af43e6b8: Revert "[NFC] Separate Peeling Properties into its own struct" (authored by anhtuyen).
Revert "[NFC] Separate Peeling Properties into its own struct"
Jul 8 2020, 12:00 PM
anhtuyen added a reverting change for rGfead250b439b: [NFC] Separate Peeling Properties into its own struct: rG6965af43e6b8: Revert "[NFC] Separate Peeling Properties into its own struct".
Jul 8 2020, 12:00 PM
anhtuyen committed rGfead250b439b: [NFC] Separate Peeling Properties into its own struct (authored by anhtuyen).
[NFC] Separate Peeling Properties into its own struct
Jul 8 2020, 11:56 AM
anhtuyen closed D80580: [NFC] Separate Peeling Properties into its own struct.
Jul 8 2020, 11:56 AM · Restricted Project

Jun 9 2020

anhtuyen committed rGe7c5412b3731: [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with -force-vector… (authored by anhtuyen).
[NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with -force-vector…
Jun 9 2020, 11:35 AM
anhtuyen closed D80446: [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with a run of -force-vector-width=1 -force-vector-interleave=4.
Jun 9 2020, 11:34 AM · Restricted Project

Jun 7 2020

anhtuyen updated the diff for D80446: [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with a run of -force-vector-width=1 -force-vector-interleave=4.

Thank you very much Ayal for your suggestion. I adjusted the file accordingly.

Jun 7 2020, 5:03 PM · Restricted Project
anhtuyen added a comment to D80446: [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with a run of -force-vector-width=1 -force-vector-interleave=4.

Hello Ayal @Ayal , when you have some time, can you review this patch to the testcases, please! Thank you very much!

Jun 7 2020, 12:46 PM · Restricted Project

May 22 2020

anhtuyen added inline comments to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 22 2020, 9:38 AM · Restricted Project
anhtuyen created D80446: [NFC][LV][TEST]: extend pr45679-fold-tail-by-masking.ll with a run of -force-vector-width=1 -force-vector-interleave=4.
May 22 2020, 9:38 AM · Restricted Project
anhtuyen committed rG13bf6039c9ae: Title: [LV] Handle Fold-Tail of loops with vectorizarion factor equal to 1 (authored by anhtuyen).
Title: [LV] Handle Fold-Tail of loops with vectorizarion factor equal to 1
May 22 2020, 6:58 AM
anhtuyen closed D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 22 2020, 6:57 AM · Restricted Project

May 19 2020

anhtuyen updated the diff for D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

Extend pr45679-fold-tail-by-masking.ll with an additional RUN of -force-vector-width=1 and -force-vector-interleave=4 from https://reviews.llvm.org/D80085.

May 19 2020, 10:30 PM · Restricted Project
anhtuyen added a comment to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

This looks good to me, thanks! Please wait a day or so if @fhahn has further comments.

As noted, it would now be good to also extend pr45679-fold-tail-by-masking.ll with an additional RUN of -force-vector-width=1 and -force-vector-interleave=4.

It is very kind of you, Ayal @Ayal , and I thank you very much. As you have mentioned, I surely will wait a day or two to see whether Florian and Bardia might have further comments.
About pr45679-fold-tail-by-masking.ll, do you want me to add it for completeness?
With VF=1, the testcase does not go through the code changed by this patch (b/c its BackedgeTakenCount is null).

May 19 2020, 9:58 PM · Restricted Project
anhtuyen added a comment to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

This looks good to me, thanks! Please wait a day or so if @fhahn has further comments.

As noted, it would now be good to also extend pr45679-fold-tail-by-masking.ll with an additional RUN of -force-vector-width=1 and -force-vector-interleave=4.

May 19 2020, 9:26 PM · Restricted Project
anhtuyen added a comment to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

Hello,
I write to ask if there is any thing else in this patch you like me to address. If not, please see if you could approve it. A number of testcases I am running are affected and it will be great if I can get them pass with this patch. Thank you very much!

May 19 2020, 12:36 PM · Restricted Project

May 17 2020

anhtuyen added inline comments to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 17 2020, 5:02 PM · Restricted Project
anhtuyen added a comment to D80085: [LV] Fix FoldTail under user VF and UF.

LGTM , too. Thanks for extending this feature.

May 17 2020, 5:02 PM · Restricted Project

May 16 2020

anhtuyen added inline comments to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 16 2020, 10:47 PM · Restricted Project
anhtuyen updated the diff for D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

Similar to the 2nd patch earlier, this patch includes all the changes recommended by the reviewers.
Also, I

  • modified the 2nd function of the LIT test to make it clearer and simpler, and
  • added ORE to confirm which pass has/does not have the impact.
May 16 2020, 9:12 PM · Restricted Project
anhtuyen added inline comments to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 16 2020, 9:12 PM · Restricted Project
anhtuyen added a comment to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

The issue has also been reported as https://bugs.llvm.org/show_bug.cgi?id=45943

May 16 2020, 4:25 PM · Restricted Project
anhtuyen added inline comments to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 16 2020, 4:25 PM · Restricted Project
anhtuyen added a reviewer for D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1: bmahjour.
May 16 2020, 1:45 PM · Restricted Project
anhtuyen updated the diff for D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.

This patch includes all the changes recommended by the reviewers - thank you very much!
I also added a new LIT test, which uses the ORE to confirm which pass has the impact.
In terms of testing, I have run a number of test-cases with it, and all were successful.

May 16 2020, 1:13 PM · Restricted Project

May 15 2020

anhtuyen added inline comments to D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 15 2020, 4:19 PM · Restricted Project

May 14 2020

anhtuyen added a comment to D78847: [LV] Fix recording of BranchTakenCount for FoldTail.

Based on discussion with Ayal, I created a quick patch to the problem of type-mismatch issue I reported above.
https://reviews.llvm.org/D79976

May 14 2020, 5:59 PM · Restricted Project
anhtuyen created D79976: [LV] Handle Fold-Tail of loops with vectorizarion factor (VF) equal to 1.
May 14 2020, 5:58 PM · Restricted Project

May 12 2020

anhtuyen added a comment to D78847: [LV] Fix recording of BranchTakenCount for FoldTail.

[snip]

Right, VPWidenCanonicalIVRecipe::execute() also needs to treat VF==1 differently.

I looked at that, too. It still gives us the assert at a different location. We will need a little more work to do.

The above implies setting both VStart to CanonicalIV instead of splatting, and VStep to ConstantInt::set(STy, Part) instead of ConstantVector::get(Indices), when VF==1. Would doing so pass all your tests?

Some of this issue stems from not using the overloaded getBroadcastInstrs().

The more general issues raised are whether to apply foldTail when VF==1 in the absence of masked scalar loads/stores, and/or whether to internally turn foldTail on for small loops (due to cost considerations) when the VF and/or UF are provided externally (bypassing their cost-based selection process).

May 12 2020, 4:09 PM · Restricted Project

May 11 2020

anhtuyen added a comment to D78847: [LV] Fix recording of BranchTakenCount for FoldTail.

[snip]

Below is an example to demonstrate that setting VTCMO to TCMO when State->VF == 1 will not help in the case of a loop of VF 1 having a vector loop-bound.

[snip]

In this case, the operand[0] (which is %vec.iv) has type <1 x i64>. The loop-bound, however, will get the type as **i64** instead of the expected **<i64 2305843009213693951>** .

Right, VPWidenCanonicalIVRecipe::execute() also needs to treat VF==1 differently.

May 11 2020, 6:56 AM · Restricted Project

May 10 2020

anhtuyen added a comment to D78847: [LV] Fix recording of BranchTakenCount for FoldTail.

Hello,

[snip]

In this example, the operand[0] (%induction) correctly has type i64, but the loop bound (14) is of vector type <1 x i64>

There might be multiple ways to address this assert failure. I list below a few simple ones for your reference: they might or might not be a good solution at all.

  1. Option 1: Not to generate the icmp instructions for %induction. In the particular case of this testcase, these instructions seem to be redundant.
  2. Option 2: If we are to generate the icmp instructions above, can we set the BackedgeTakenCount to the State depending on the type of the first operand? In cases like this one when the first operand is not a vector type, using Value *TCMO instead of Value *VTCMO might be an option.

I will open a Bugzzila and copy its link to this page when my password reset goes through.

Thanks,
Anh

Yes, thanks for catching this!
One quick fix is indeed to set VTCMO to TCMO when State->VF == 1, instead of "splatting" it into a vector of a single element.
Thinking if fold-tail-by-masking should be restricted to work for VF>1 only, given that only vectors (loads/stores) get masked.

I also came up (and gave up) that fix last week, because it would not work for a loop whose VF is 1, but the loop bound is a vector. I will come up with an example shortly to demonstrate my thought.

May 10 2020, 9:49 PM · Restricted Project
anhtuyen added a comment to D78847: [LV] Fix recording of BranchTakenCount for FoldTail.

Hello,

[snip]

In this example, the operand[0] (%induction) correctly has type i64, but the loop bound (14) is of vector type <1 x i64>

There might be multiple ways to address this assert failure. I list below a few simple ones for your reference: they might or might not be a good solution at all.

  1. Option 1: Not to generate the icmp instructions for %induction. In the particular case of this testcase, these instructions seem to be redundant.
  2. Option 2: If we are to generate the icmp instructions above, can we set the BackedgeTakenCount to the State depending on the type of the first operand? In cases like this one when the first operand is not a vector type, using Value *TCMO instead of Value *VTCMO might be an option.

I will open a Bugzzila and copy its link to this page when my password reset goes through.

Thanks,
Anh

Yes, thanks for catching this!
One quick fix is indeed to set VTCMO to TCMO when State->VF == 1, instead of "splatting" it into a vector of a single element.
Thinking if fold-tail-by-masking should be restricted to work for VF>1 only, given that only vectors (loads/stores) get masked.

May 10 2020, 8:13 PM · Restricted Project
anhtuyen added a comment to D78847: [LV] Fix recording of BranchTakenCount for FoldTail.

The new fix delivered in this patch has caused an assert failure with a testcase having a loop with a very small trip count going through fold tail by masking.
The reduced testcase is as follows. The options are: -loop-vectorize -force-vector-interleave=4

May 10 2020, 3:58 PM · Restricted Project

Apr 29 2020

anhtuyen committed rGc7878ad231ee: [VFDatabase] Scalar functions are vector functions with VF =1 (authored by anhtuyen).
[VFDatabase] Scalar functions are vector functions with VF =1
Apr 29 2020, 10:44 AM
anhtuyen closed D78054: [VFDatabase] Scalar functions are vector functions with VF =1.
Apr 29 2020, 10:44 AM · Restricted Project

Feb 19 2020

anhtuyen added inline comments to D73707: [TSAN] Parameterize the hard-coded threshold of deflake in tsan test.
Feb 19 2020, 1:48 PM · Restricted Project, Restricted Project