Page MenuHomePhabricator

mgrang (Mandeep Singh Grang)
Spy

Projects

User does not belong to any projects.

User Details

User Since
Jan 28 2015, 2:26 PM (425 w, 1 d)

Recent Activity

Feb 8 2021

mgrang added a comment to D65249: [NFC] use C++11 in AlignOf.h, remove AlignedCharArray.

Hi @jfb @rnk This patch results in a compiler crash when building a simple C program on a Windows X86 Debug build. I have filed this issue to track it.

Feb 8 2021, 12:10 PM · Restricted Project, Restricted Project, Restricted Project

Apr 27 2020

mgrang updated the diff for D78853: [Analysis] Fix null pointer dereference warnings [1/n].
Apr 27 2020, 7:24 PM
mgrang added a comment to D78853: [Analysis] Fix null pointer dereference warnings [1/n].

Please don't add null checks for pointers that can't be null. It makes the code slower and harder to understand. And least one of the checks you added is actively breaking the code.

In some cases, the analysis is pointing to cases where the code could be made more clear for both humans and machines with some refactoring or assertions. Patches welcome, but please make sure any assertions properly explain the invariant. And please split the patches up a bit more; adding assertions for complex invariants in ten different unrelated places is more than I really want to review at once.

(Also, a reminder, please post patches with full context.)

Apr 27 2020, 1:27 PM

Apr 24 2020

mgrang created D78853: [Analysis] Fix null pointer dereference warnings [1/n].
Apr 24 2020, 9:05 PM

Dec 12 2019

mgrang added inline comments to rG69d67d3d8049: [IndexDataStore] Sort unit names using std::sort().
Dec 12 2019, 2:29 PM

Nov 15 2019

mgrang accepted D70288: [ADT][Expensive checks] Create a /dev/random seed only once when shuffling the range before sorting it to avoid bot timeouts.

Thanks for fixing this. LGTM.

Nov 15 2019, 10:59 AM · Restricted Project

Sep 10 2019

GitHub <noreply@github.com> committed rGb67aff2d3143: Merge d4bd9b25953685becc1b8f704e5355c897e40425 into… (authored by mgrang).
Merge d4bd9b25953685becc1b8f704e5355c897e40425 into…
Sep 10 2019, 3:26 PM
mgrang committed rGd4bd9b259536: Cherry-picked from commit 628e418df1a009e0d073545cbef3604350e7b808 Merge… (authored by mgrang).
Cherry-picked from commit 628e418df1a009e0d073545cbef3604350e7b808 Merge…
Sep 10 2019, 3:26 PM
mgrang added inline comments to D67383: Add new optimization pass of Tree-Height-Reduction.
Sep 10 2019, 3:12 PM · Restricted Project, Restricted Project
mgrang accepted D66114: [ConstantHoisting] Fix non-determinism..

LGTM.

Sep 10 2019, 9:56 AM · Restricted Project

Aug 27 2019

mgrang added inline comments to D66498: [GlobalISel] Import patterns containing INSERT_SUBREG.
Aug 27 2019, 12:14 PM · Restricted Project
mgrang added inline comments to D66766: [SampleFDO] Add symbol whitelist section to discriminate function being cold versus function being newly added.
Aug 27 2019, 12:08 PM · Restricted Project

Aug 22 2019

mgrang added inline comments to D66411: Fix -ftime-trace breaking flame-graph assumptions.
Aug 22 2019, 10:06 AM · Restricted Project

Aug 19 2019

mgrang added inline comments to D66374: [SampleFDO] Add symbol whitelist in the profile and use it when profile-sample-accurate is enabled.
Aug 19 2019, 2:55 PM · Restricted Project

Aug 18 2019

mgrang added inline comments to D66399: [ORCv2] - New Speculate Query Implementation.
Aug 18 2019, 11:18 PM · Restricted Project, Restricted Project

Aug 16 2019

mgrang added inline comments to D66122: [CodeGen] Emit dynamic initializers for static TLS vars in outlined scopes.
Aug 16 2019, 4:13 PM · Restricted Project, Restricted Project
mgrang added inline comments to D65614: [Reassociate] Stop linearizing all associative expression trees w/o profitability.
Aug 16 2019, 9:58 AM · Restricted Project

Aug 12 2019

mgrang added a comment to D66114: [ConstantHoisting] Fix non-determinism..

Have you tried measuring compile-time on some benchmark with this patch. Changing unordered containers to ordered ones can increase compile-time. What if you simply sort the containers before iteration?

Aug 12 2019, 3:45 PM · Restricted Project

Aug 9 2019

mgrang added inline comments to D66029: llvm-canon.
Aug 9 2019, 2:00 PM · Restricted Project

May 24 2019

mgrang committed rG0cdc5dddca00: [Analyzer] Checker for non-determinism caused by iteration of unordered… (authored by mgrang).
[Analyzer] Checker for non-determinism caused by iteration of unordered…
May 24 2019, 12:23 PM
mgrang committed rC361664: [Analyzer] Checker for non-determinism caused by iteration of unordered….
[Analyzer] Checker for non-determinism caused by iteration of unordered…
May 24 2019, 12:23 PM
mgrang committed rL361664: [Analyzer] Checker for non-determinism caused by iteration of unordered….
[Analyzer] Checker for non-determinism caused by iteration of unordered…
May 24 2019, 12:22 PM
mgrang closed D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.
May 24 2019, 12:22 PM · Restricted Project, Restricted Project

May 15 2019

mgrang committed rG814435fe8741: [AArch64] only indicate CFI on Windows if we emitted CFI (authored by mgrang).
[AArch64] only indicate CFI on Windows if we emitted CFI
May 15 2019, 2:22 PM
mgrang committed rL360816: [AArch64] only indicate CFI on Windows if we emitted CFI.
[AArch64] only indicate CFI on Windows if we emitted CFI
May 15 2019, 2:21 PM
mgrang closed D61960: [AArch64] only indicate CFI on Windows if we emitted CFI.
May 15 2019, 2:21 PM · Restricted Project

May 7 2019

mgrang added inline comments to D61626: [RISCV] Disable tail call if the callee function contain __builtin_frame_address or __builtin_return_address.
May 7 2019, 12:33 PM · Restricted Project

May 6 2019

mgrang accepted D61590: [AArch64] Default to SEH exception handling on MinGW.
May 6 2019, 12:04 PM · Restricted Project
mgrang accepted D61592: [AArch64] Add __builtin_sponentry, for calling setjmp in MinGW.
May 6 2019, 12:04 PM · Restricted Project
mgrang accepted D61591: [MinGW] Use SEH by default on AArch64.
May 6 2019, 12:04 PM · Restricted Project, Restricted Project

May 3 2019

mgrang committed rG5dc8aeb26d28: [COFF, ARM64] Fix ABI implementation of struct returns (authored by mgrang).
[COFF, ARM64] Fix ABI implementation of struct returns
May 3 2019, 2:13 PM
mgrang committed rG85a0f8fe6c5c: [COFF, ARM64] Fix ABI implementation of struct returns (authored by mgrang).
[COFF, ARM64] Fix ABI implementation of struct returns
May 3 2019, 2:12 PM
mgrang committed rL359934: [COFF, ARM64] Fix ABI implementation of struct returns.
[COFF, ARM64] Fix ABI implementation of struct returns
May 3 2019, 2:12 PM
mgrang closed D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
May 3 2019, 2:12 PM · Restricted Project
mgrang committed rL359932: [COFF, ARM64] Fix ABI implementation of struct returns.
[COFF, ARM64] Fix ABI implementation of struct returns
May 3 2019, 2:12 PM
mgrang committed rC359932: [COFF, ARM64] Fix ABI implementation of struct returns.
[COFF, ARM64] Fix ABI implementation of struct returns
May 3 2019, 2:11 PM
mgrang closed D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
May 3 2019, 2:11 PM · Restricted Project

May 2 2019

mgrang added a comment to D60349: [COFF, ARM64] Fix ABI implementation of struct returns.

LGTM, assuming it passes testing on electron

May 2 2019, 12:27 PM · Restricted Project
mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
May 2 2019, 11:08 AM · Restricted Project

Apr 30 2019

mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 30 2019, 2:12 PM · Restricted Project

Apr 29 2019

mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 29 2019, 12:37 PM · Restricted Project
mgrang added a comment to D60349: [COFF, ARM64] Fix ABI implementation of struct returns.

Thanks @richard.townsend.arm . I have updated the patch.

Apr 29 2019, 12:05 PM · Restricted Project
mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 29 2019, 12:04 PM · Restricted Project

Apr 26 2019

mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 26 2019, 11:57 AM · Restricted Project
mgrang added a comment to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.

@rnk @efriedma Is this patch good to commit?

Apr 26 2019, 11:35 AM · Restricted Project

Apr 25 2019

mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 25 2019, 6:31 PM · Restricted Project

Apr 24 2019

mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 24 2019, 4:22 PM · Restricted Project
mgrang added inline comments to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 24 2019, 2:01 PM · Restricted Project

Apr 23 2019

mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 23 2019, 3:16 PM · Restricted Project
mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 23 2019, 3:14 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 23 2019, 2:57 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 23 2019, 2:54 PM · Restricted Project
mgrang added inline comments to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 23 2019, 2:22 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 23 2019, 1:45 PM · Restricted Project

Apr 22 2019

mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 22 2019, 4:03 PM · Restricted Project
mgrang added inline comments to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 22 2019, 3:45 PM · Restricted Project
mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 22 2019, 3:40 PM · Restricted Project
mgrang added a comment to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.

Do you need to modify AArch64TargetLowering::isEligibleForTailCallOptimization to prevent a tail call in cases where the tail call would return the wrong value?

Apr 22 2019, 3:19 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 22 2019, 3:17 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 22 2019, 1:21 PM · Restricted Project
mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 22 2019, 11:57 AM · Restricted Project

Apr 19 2019

mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 19 2019, 4:23 PM · Restricted Project
mgrang added a comment to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.

Thanks @kristof.beyls for the review. We are still working on the combining the clang patches which should fix PR41135 and PR41136. I will then add unit tests to this patch.

Apr 19 2019, 12:21 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 19 2019, 12:21 PM · Restricted Project

Apr 12 2019

mgrang added a comment to D60349: [COFF, ARM64] Fix ABI implementation of struct returns.

The document you linked in the LLVM change (https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=vs-2019#return-values) says that small POD types are returned directly in X0 or X0 and X1, but this looks like it will always return them indirectly. I think we also need to check the size of the type, and fall back the the plain C ABI for small types.

Apr 12 2019, 1:43 PM · Restricted Project
mgrang updated the diff for D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 12 2019, 1:43 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 12 2019, 1:39 PM · Restricted Project

Apr 11 2019

mgrang added inline comments to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 11 2019, 11:50 AM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 11 2019, 11:44 AM · Restricted Project

Apr 10 2019

mgrang added a comment to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.

The new patch now also handles struct returns for instance methods.

Apr 10 2019, 5:30 PM · Restricted Project
mgrang updated the diff for D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 10 2019, 5:30 PM · Restricted Project

Apr 5 2019

mgrang added a comment to D60349: [COFF, ARM64] Fix ABI implementation of struct returns.

Got rid of the confusing SuppressSRet logic. The "inreg" attribute is now used to indicate sret returns in X0.

Apr 5 2019, 5:44 PM · Restricted Project
mgrang added a comment to D60348: [COFF, ARM64] Fix ABI implementation of struct returns.

Refer https://bugs.llvm.org/show_bug.cgi?id=41135 for a detailed discussion on the issue. Please review this and the related clang patch and let me know if this implementation is something we can proceed with.

Apr 5 2019, 5:41 PM · Restricted Project
mgrang updated the summary of D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 5 2019, 5:38 PM · Restricted Project
mgrang created D60349: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 5 2019, 5:38 PM · Restricted Project
mgrang created D60348: [COFF, ARM64] Fix ABI implementation of struct returns.
Apr 5 2019, 5:35 PM · Restricted Project

Mar 22 2019

mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

Although, as you rightly pointed out that ordered sets of pointers are as non-deterministic as unordered ones.

What if you store pointers to the elements of an array? In that case, it should be deterministic.

-----------
|1|2|3|5|6|
-----------
 ^     ^ 
 p     q

In the above example, pointer p's memory address will always be less then q's, so in an ordered set, iterating over them would be deterministic. When hashing algorithms come into the picture, than it wouldn't be :^)

Mar 22 2019, 10:23 AM · Restricted Project, Restricted Project

Mar 21 2019

mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

Following are the assumptions/limitations of this patch:

1. The assumption is that iteration of ordered containers of pointers is not non-deterministic.

Could you please explain which type of non-determinism we are addressing here? If our issue is that iteration order is not consistent across runs, then an unordered set of integers seems just as non-deterministic as an unordered set of pointers. On the other hand, if our issue is that pointer values vary between runs, then an ordered set of pointers seems just as non-deterministic as an unordered set of pointers. Are unordered sets of pointers distinguished because they lie in the intersection of these categories and thus avoid the most false positive cases? If so, for someone debugging non-deterministic behavior in their code, would it be useful to add a strict option that shows other cases too? If not, maybe we could document our reasons somewhere.

Mar 21 2019, 1:25 PM · Restricted Project, Restricted Project

Mar 20 2019

mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

Ping for reviews please.

Mar 20 2019, 10:57 AM · Restricted Project, Restricted Project

Mar 14 2019

mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

I was trying to write another checker for hashing of pointers. Basically, I wanted to match all instances where the keys of std::map are pointers. Writing an AST matcher for std::map is straightforward. However, I am not sure how to check for pointer keys after matching std::map.

Mar 14 2019, 12:37 PM · Restricted Project, Restricted Project

Mar 13 2019

mgrang updated the diff for D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.
Mar 13 2019, 12:29 PM · Restricted Project, Restricted Project
mgrang committed rG6952b82c6750: [Analyzer] Clean up test/Analysis/ptr-sort.cpp (authored by mgrang).
[Analyzer] Clean up test/Analysis/ptr-sort.cpp
Mar 13 2019, 12:22 PM
mgrang committed rL356088: [Analyzer] Clean up test/Analysis/ptr-sort.cpp.
[Analyzer] Clean up test/Analysis/ptr-sort.cpp
Mar 13 2019, 12:22 PM
mgrang committed rC356088: [Analyzer] Clean up test/Analysis/ptr-sort.cpp.
[Analyzer] Clean up test/Analysis/ptr-sort.cpp
Mar 13 2019, 12:22 PM
mgrang committed rGcf7d9f909022: [Analyzer] Update the LLVM license in PointerSortingChecker.cpp (authored by mgrang).
[Analyzer] Update the LLVM license in PointerSortingChecker.cpp
Mar 13 2019, 12:12 PM
mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

Could you please add a commit that changes the top of the file on your previous commit? Feel free to do that without review (I can't commit it myself atm).

Mar 13 2019, 12:12 PM · Restricted Project, Restricted Project
mgrang committed rL356086: [Analyzer] Update the LLVM license in PointerSortingChecker.cpp.
[Analyzer] Update the LLVM license in PointerSortingChecker.cpp
Mar 13 2019, 12:09 PM
mgrang committed rC356086: [Analyzer] Update the LLVM license in PointerSortingChecker.cpp.
[Analyzer] Update the LLVM license in PointerSortingChecker.cpp
Mar 13 2019, 12:08 PM
mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

Also, what is the difference between these two: https://clang.llvm.org/docs/analyzer/checkers.html, https://clang-analyzer.llvm.org/available_checks.html. It seems they document similar stuff. Should we add the doc for each new checker in both of these?

Mar 13 2019, 11:05 AM · Restricted Project, Restricted Project
mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

The obvious question, why not implement this in clang-tidy?

Mar 13 2019, 11:05 AM · Restricted Project, Restricted Project
mgrang updated the diff for D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.
Mar 13 2019, 10:53 AM · Restricted Project, Restricted Project

Mar 12 2019

mgrang added a comment to D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.

Following are the assumptions/limitations of this patch:

Mar 12 2019, 5:29 PM · Restricted Project, Restricted Project
mgrang created D59279: [Analyzer] Checker for non-determinism caused by iteration of unordered container of pointers.
Mar 12 2019, 5:23 PM · Restricted Project, Restricted Project

Mar 8 2019

mgrang committed rGd4c4f7440e00: [docs] Fix checkers.rst doc for PointerSorting checker (authored by mgrang).
[docs] Fix checkers.rst doc for PointerSorting checker
Mar 8 2019, 12:36 PM
mgrang committed rL355726: [docs] Fix checkers.rst doc for PointerSorting checker.
[docs] Fix checkers.rst doc for PointerSorting checker
Mar 8 2019, 12:34 PM
mgrang committed rC355726: [docs] Fix checkers.rst doc for PointerSorting checker.
[docs] Fix checkers.rst doc for PointerSorting checker
Mar 8 2019, 12:34 PM
mgrang committed rGc0773ab6a164: [Analyzer] Checker for non-determinism caused by sorting of pointer-like… (authored by mgrang).
[Analyzer] Checker for non-determinism caused by sorting of pointer-like…
Mar 8 2019, 12:15 PM
mgrang committed rC355720: [Analyzer] Checker for non-determinism caused by sorting of pointer-like….
[Analyzer] Checker for non-determinism caused by sorting of pointer-like…
Mar 8 2019, 12:15 PM
mgrang committed rL355720: [Analyzer] Checker for non-determinism caused by sorting of pointer-like….
[Analyzer] Checker for non-determinism caused by sorting of pointer-like…
Mar 8 2019, 12:15 PM
mgrang closed D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like elements.
Mar 8 2019, 12:14 PM · Restricted Project, Restricted Project