Page MenuHomePhabricator

nicholas (Nick Lewycky)
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 15 2012, 11:56 PM (356 w, 5 d)

Recent Activity

Jun 13 2019

nicholas added a comment to D63315: [Attributor] Regularly clear dependences to remove spurious ones.

Could you include a test with this patch?

Jun 13 2019, 10:08 PM · Restricted Project
nicholas added a comment to D63312: [Attributor] Deduce attributes for non-exact functions.

We can, however, use information from non-exact definitions to improve
themselves as they are either replaced as a whole or not at all.

Jun 13 2019, 9:46 PM · Restricted Project
nicholas added inline comments to D63046: [Attributor] Deduce "willreturn" function attribute.
Jun 13 2019, 1:38 PM · Restricted Project

Jun 9 2019

nicholas added a comment to D63046: [Attributor] Deduce "willreturn" function attribute.

The current algorithm can deduce only for very simple cases.

  • A function doesn't have any loop.
  • A function doesn't have any recursion.

What about functions that exit the program, throw an exception, or longjmp?

Jun 9 2019, 8:17 PM · Restricted Project
nicholas added a comment to D63046: [Attributor] Deduce "willreturn" function attribute.

The current algorithm can deduce only for very simple cases.

  • A function doesn't have any loop.
  • A function doesn't have any recursion.
Jun 9 2019, 8:12 PM · Restricted Project
nicholas added a comment to D59919: [Attributor] Deduce "returned" argument attribute.

Why did the number of nounwinds drop?

Jun 9 2019, 11:39 AM · Restricted Project, Restricted Project

Jun 8 2019

nicholas added a comment to D60074: [Attributor] Deduce "no-recurse" function attribute.

Thanks for the extensive comment!

Is it actually correct to derive norecurse like this?

Suppose I have two functions:

void f(int x) { if (x) { g(); } }
void g() { f(0); }

As far as I can tell, it would be correct to mark g() norecurse. And if g() is marked norecurse, we'll mark f() norecurse, which is wrong.

We should/do not mark g as norecurse in this example. At least not if f is externally visible.

Could you explain a little further? I don't see how changing whether f is externally visible changes whether it's OK to mark g with norecurse. Here's my thinking. If f is externally visible that means it can be called from external code, and we have to make the worst-case assumption about the call stack, but in this case we know that g can't be on the call stack since g doesn't call any external functions. Is that right?

I should have explained this better from the beginning. At the moment, for better or worse, we derive norecurse only if the function does not call a recursive function. I did not want to change this behavior in this patch but I'm willing to investigate if we should. Now, in the example above, f is recursive as it calls g which calls f. And g is recursive as it calls f which was recursive. My internal comment was following this logic: If f was internal, we could (conceptually) eliminate the call of g after IPSCCP and thereby making both functions non-recursive.

Jun 8 2019, 11:52 AM · Restricted Project

Jun 6 2019

nicholas added a comment to D60074: [Attributor] Deduce "no-recurse" function attribute.

Is it actually correct to derive norecurse like this?

Suppose I have two functions:

void f(int x) { if (x) { g(); } }
void g() { f(0); }

As far as I can tell, it would be correct to mark g() norecurse. And if g() is marked norecurse, we'll mark f() norecurse, which is wrong.

We should/do not mark g as norecurse in this example. At least not if f is externally visible.

Jun 6 2019, 1:30 AM · Restricted Project

Apr 27 2019

nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..

This update adds a failing test @test21 which demonstrates a miscompile. While we check the block with the free in it for potentially-malloc'ing instructions, we don't examine all the possible paths from where that free was pre-transform to the new location of the free post-transform.

Apr 27 2019, 11:14 AM · Restricted Project

Apr 26 2019

nicholas committed rG1d30f0c93e7c: Fix typo in documentation. (authored by nicholas).
Fix typo in documentation.
Apr 26 2019, 10:59 AM
nicholas committed rCTE359329: Fix typo in documentation..
Fix typo in documentation.
Apr 26 2019, 10:58 AM
nicholas committed rL359329: Fix typo in documentation..
Fix typo in documentation.
Apr 26 2019, 10:54 AM

Apr 16 2019

nicholas added reviewers for D60356: Accelerate isPotentiallyReachable when a DominatorTree is available.: bruno, asbirlea.

CFG.cpp doesn't have many non-cleanup authors, Bruno once made a change all the way back in 2015 to improve the performance of isPotentiallyReachable. Alina, I've added you since you reviewed my previous change to isPotentiallyReachable when it affected LICM. This series of patches improves performance of isPotentiallyReachable, primary by taking advantage of dominator tree properties.

Apr 16 2019, 10:17 PM · Restricted Project
nicholas added a child revision for D60755: [NFCI] Improve efficiency of isPotentiallyReachableFromManyDomTree.: D60756: [NFCI] Replace linear scan with bisection..
Apr 16 2019, 12:53 AM · Restricted Project
nicholas added a parent revision for D60756: [NFCI] Replace linear scan with bisection.: D60755: [NFCI] Improve efficiency of isPotentiallyReachableFromManyDomTree..
Apr 16 2019, 12:53 AM · Restricted Project
nicholas created D60756: [NFCI] Replace linear scan with bisection..
Apr 16 2019, 12:53 AM · Restricted Project
nicholas added a child revision for D60753: [NFCI] Split isPotentiallyReachable into two implementations.: D60755: [NFCI] Improve efficiency of isPotentiallyReachableFromManyDomTree..
Apr 16 2019, 12:49 AM · Restricted Project
nicholas added a child revision for D60754: Add forEachDescendant to DominatorTree.: D60755: [NFCI] Improve efficiency of isPotentiallyReachableFromManyDomTree..
Apr 16 2019, 12:49 AM · Restricted Project
nicholas added parent revisions for D60755: [NFCI] Improve efficiency of isPotentiallyReachableFromManyDomTree.: D60754: Add forEachDescendant to DominatorTree., D60753: [NFCI] Split isPotentiallyReachable into two implementations..
Apr 16 2019, 12:49 AM · Restricted Project
nicholas created D60755: [NFCI] Improve efficiency of isPotentiallyReachableFromManyDomTree..
Apr 16 2019, 12:49 AM · Restricted Project
nicholas created D60754: Add forEachDescendant to DominatorTree..
Apr 16 2019, 12:47 AM · Restricted Project
nicholas added a parent revision for D60753: [NFCI] Split isPotentiallyReachable into two implementations.: D60752: [NFCI] Use less memory by storing the Loop* as visited instead of storing each BasicBlock* in the block as visited..
Apr 16 2019, 12:42 AM · Restricted Project
nicholas created D60753: [NFCI] Split isPotentiallyReachable into two implementations..
Apr 16 2019, 12:42 AM · Restricted Project
nicholas added a child revision for D60752: [NFCI] Use less memory by storing the Loop* as visited instead of storing each BasicBlock* in the block as visited.: D60753: [NFCI] Split isPotentiallyReachable into two implementations..
Apr 16 2019, 12:42 AM · Restricted Project
nicholas added a parent revision for D60752: [NFCI] Use less memory by storing the Loop* as visited instead of storing each BasicBlock* in the block as visited.: D60357: Improve visited block tracking in isPotentiallyReachable..
Apr 16 2019, 12:38 AM · Restricted Project
nicholas created D60752: [NFCI] Use less memory by storing the Loop* as visited instead of storing each BasicBlock* in the block as visited..
Apr 16 2019, 12:38 AM · Restricted Project
nicholas added a child revision for D60357: Improve visited block tracking in isPotentiallyReachable.: D60752: [NFCI] Use less memory by storing the Loop* as visited instead of storing each BasicBlock* in the block as visited..
Apr 16 2019, 12:38 AM · Restricted Project

Apr 15 2019

nicholas added a comment to D60659: [InstCombine] Eliminate stores to constant memory.

Why do you think a store through constant would break subtly? For most users I'd expect a store to a constant to correspond with a write to a read-only page causing a loud crash.

I assume you mean before this patch right? If so, then yes and no. It's possible the constant location is in a readonly page, but I have a lot of downstream constant locations which are intermixed with writeable data. I'm sure other frontends might have the same. Your reasoning may hold specifically for global constants though.

Apr 15 2019, 11:37 AM · Restricted Project

Apr 13 2019

nicholas added a comment to D60659: [InstCombine] Eliminate stores to constant memory.

The two statements:

We could simply say that the store *is undefined*, and prune the path.

and

The motivating case for this involves a memmove to a buffer which is constant down a path which is dynamically dead.

conspire to make me think that pruning the whole path really is the right thing to do. This might be the only hint the compiler has that the path is dead code.

Apr 13 2019, 3:18 PM · Restricted Project

Apr 11 2019

nicholas added inline comments to D60056: Hoist/sink malloc/free's in LICM..
Apr 11 2019, 12:46 PM · Restricted Project
nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..
Apr 11 2019, 12:45 PM · Restricted Project

Apr 10 2019

nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..
Apr 10 2019, 11:22 PM · Restricted Project

Apr 6 2019

nicholas committed rG383419f70782: [NFC] Fix typo in comment. (authored by nicholas).
[NFC] Fix typo in comment.
Apr 6 2019, 3:05 PM
nicholas committed rL357849: [NFC] Fix typo in comment..
[NFC] Fix typo in comment.
Apr 6 2019, 3:05 PM
nicholas updated the summary of D60356: Accelerate isPotentiallyReachable when a DominatorTree is available..
Apr 6 2019, 12:54 AM · Restricted Project
nicholas updated the summary of D60357: Improve visited block tracking in isPotentiallyReachable..
Apr 6 2019, 12:54 AM · Restricted Project
nicholas updated the summary of D60356: Accelerate isPotentiallyReachable when a DominatorTree is available..
Apr 6 2019, 12:50 AM · Restricted Project

Apr 5 2019

nicholas updated the diff for D60357: Improve visited block tracking in isPotentiallyReachable..
Apr 5 2019, 9:28 PM · Restricted Project
nicholas retitled D60357: Improve visited block tracking in isPotentiallyReachable. from Improve visited block tracking is isPotentiallyReachable. to Improve visited block tracking in isPotentiallyReachable..
Apr 5 2019, 9:28 PM · Restricted Project
nicholas created D60357: Improve visited block tracking in isPotentiallyReachable..
Apr 5 2019, 9:22 PM · Restricted Project
nicholas added a child revision for D60356: Accelerate isPotentiallyReachable when a DominatorTree is available.: D60357: Improve visited block tracking in isPotentiallyReachable..
Apr 5 2019, 9:22 PM · Restricted Project
nicholas added a parent revision for D60357: Improve visited block tracking in isPotentiallyReachable.: D60356: Accelerate isPotentiallyReachable when a DominatorTree is available..
Apr 5 2019, 9:22 PM · Restricted Project
nicholas created D60356: Accelerate isPotentiallyReachable when a DominatorTree is available..
Apr 5 2019, 8:39 PM · Restricted Project

Apr 4 2019

nicholas closed D60171: An unreachable block may have a route to a reachable block, don't fast-path return that it can't..

rL357734

Apr 4 2019, 4:13 PM · Restricted Project
nicholas committed rGa6ed16c98f50: An unreachable block may have a route to a reachable block, don't fast-path… (authored by nicholas).
An unreachable block may have a route to a reachable block, don't fast-path…
Apr 4 2019, 4:09 PM
nicholas committed rL357734: An unreachable block may have a route to a reachable block, don't fast-path….
An unreachable block may have a route to a reachable block, don't fast-path…
Apr 4 2019, 4:08 PM
nicholas updated the summary of D60171: An unreachable block may have a route to a reachable block, don't fast-path return that it can't..
Apr 4 2019, 12:54 PM · Restricted Project

Apr 3 2019

nicholas updated the summary of D60171: An unreachable block may have a route to a reachable block, don't fast-path return that it can't..
Apr 3 2019, 12:20 PM · Restricted Project

Apr 2 2019

nicholas added inline comments to D60031: Split tailcallelim into tailcallmark and tailcallelim.
Apr 2 2019, 10:28 PM · Restricted Project
nicholas created D60171: An unreachable block may have a route to a reachable block, don't fast-path return that it can't..
Apr 2 2019, 7:41 PM · Restricted Project
nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..

Fixed creation of invalid IR when the loop exit block we need to insert a free call in, is a catchswitch block.

Apr 2 2019, 1:31 PM · Restricted Project

Apr 1 2019

nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..
Apr 1 2019, 7:47 PM · Restricted Project
nicholas added a comment to D60056: Hoist/sink malloc/free's in LICM..

Should I pull it out of hoisting and sinking and into a post-pass like LICM's scalar promotion? Initially I had imagined that it would participate in hoist and sink's queries of whether "are all arguments to this instruction loop invariant (outside the loop)" as hoists instructions iterately, it would hoist malloc like any other instruction. In practice that couldn't happen because the hoist is deferred until sink time.

Apr 1 2019, 7:45 PM · Restricted Project
nicholas added a comment to D60056: Hoist/sink malloc/free's in LICM..

I've only skimmed through the high level comments so far, so if if any of this is addressed inline, just say so.

I was wondering why you phrased this as a combination of hoisting and sinking as opposed to promotion. We have the scalar promotion path, and the basic transform you're doing feels a lot like promotion. I suspect that many of the legality aspects will be common.

Apr 1 2019, 7:02 PM · Restricted Project
nicholas committed rGc0ebfbe3f321: Add an optional list of blocks to avoid when looking for a path in… (authored by nicholas).
Add an optional list of blocks to avoid when looking for a path in…
Apr 1 2019, 6:06 PM
nicholas committed rL357447: Add an optional list of blocks to avoid when looking for a path in….
Add an optional list of blocks to avoid when looking for a path in…
Apr 1 2019, 6:06 PM
nicholas closed D60085: Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable..
Apr 1 2019, 6:06 PM · Restricted Project
nicholas committed rG1e1e212d274c: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing… (authored by nicholas).
[NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing…
Apr 1 2019, 1:42 PM
nicholas committed rL357427: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing….
[NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing…
Apr 1 2019, 1:36 PM
nicholas closed D60084: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace..
Apr 1 2019, 1:36 PM · Restricted Project
nicholas closed D60082: Not all blocks are reachable from entry. Don't assume they are..

Committed revision 357425.

Apr 1 2019, 1:13 PM · Restricted Project
nicholas committed rG66d7eb97045e: Not all blocks are reachable from entry. Don't assume they are. (authored by nicholas).
Not all blocks are reachable from entry. Don't assume they are.
Apr 1 2019, 1:05 PM
nicholas committed rL357425: Not all blocks are reachable from entry. Don't assume they are..
Not all blocks are reachable from entry. Don't assume they are.
Apr 1 2019, 1:05 PM
nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..
Apr 1 2019, 12:36 PM · Restricted Project
nicholas added inline comments to D60031: Split tailcallelim into tailcallmark and tailcallelim.
Apr 1 2019, 12:19 PM · Restricted Project
nicholas updated the diff for D60056: Hoist/sink malloc/free's in LICM..
Apr 1 2019, 12:01 PM · Restricted Project
nicholas updated the summary of D60056: Hoist/sink malloc/free's in LICM..
Apr 1 2019, 12:01 PM · Restricted Project
nicholas added a child revision for D60084: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace.: D60056: Hoist/sink malloc/free's in LICM..
Apr 1 2019, 11:55 AM · Restricted Project
nicholas added a child revision for D60085: Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable.: D60056: Hoist/sink malloc/free's in LICM..
Apr 1 2019, 11:55 AM · Restricted Project
nicholas added parent revisions for D60056: Hoist/sink malloc/free's in LICM.: D60084: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace., D60085: Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable..
Apr 1 2019, 11:55 AM · Restricted Project
nicholas added a child revision for D60082: Not all blocks are reachable from entry. Don't assume they are.: D60085: Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable..
Apr 1 2019, 11:55 AM · Restricted Project
nicholas added a parent revision for D60085: Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable.: D60082: Not all blocks are reachable from entry. Don't assume they are..
Apr 1 2019, 11:55 AM · Restricted Project
nicholas created D60085: Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable..
Apr 1 2019, 11:55 AM · Restricted Project
nicholas added a reviewer for D60084: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace.: asbirlea.
Apr 1 2019, 11:49 AM · Restricted Project
nicholas created D60084: [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace..
Apr 1 2019, 11:48 AM · Restricted Project
nicholas added a reviewer for D60082: Not all blocks are reachable from entry. Don't assume they are.: asbirlea.
Apr 1 2019, 11:47 AM · Restricted Project
nicholas created D60082: Not all blocks are reachable from entry. Don't assume they are..
Apr 1 2019, 11:41 AM · Restricted Project

Mar 31 2019

nicholas added reviewers for D60056: Hoist/sink malloc/free's in LICM.: asbirlea, george.burgess.iv, reames.
Mar 31 2019, 10:24 PM · Restricted Project
nicholas created D60056: Hoist/sink malloc/free's in LICM..
Mar 31 2019, 10:21 PM · Restricted Project

Nov 8 2018

nicholas added a comment to D53556: [Interpreter] Fix out-of-bounds access in ffiInvoke.

Could you commit this patch on my behalf?

Nov 8 2018, 10:34 AM

Oct 23 2018

nicholas accepted D53556: [Interpreter] Fix out-of-bounds access in ffiInvoke.
Oct 23 2018, 12:43 AM

Oct 16 2018

nicholas committed rL344638: Fix typo Registraction --> Registration, and closing link tag..
Fix typo Registraction --> Registration, and closing link tag.
Oct 16 2018, 11:51 AM

Oct 5 2018

nicholas added a comment to D52895: [TailCallElim] Enable marking of calls with byval as tails.

I misspoke, I meant to say please wait for another reviewer. I've been away from LLVM long enough that I don't have enough context to OK patches to land, but I didn't mean that rnk must be the other reviewer. Sorry!

Oct 5 2018, 3:25 PM
nicholas added a comment to D52895: [TailCallElim] Enable marking of calls with byval as tails.

This looks good to me, but please wait for rnk.

Oct 5 2018, 3:23 PM

Oct 4 2018

nicholas added a comment to D52895: [TailCallElim] Enable marking of calls with byval as tails.
In D52895#1255738, @rnk wrote:

Nice!

I don't understand the logical model behind byval, but I'll review the change to TRE under the assumption that the goal of the patch is correct.

You have to hallucinate an implicit memcpy into the call sequence. Its destination is some stack memory allocated during the call sequence not visible from LLVM IR.

Oct 4 2018, 3:16 PM
nicholas added a comment to D52895: [TailCallElim] Enable marking of calls with byval as tails.

I don't understand the logical model behind byval, but I'll review the change to TRE under the assumption that the goal of the patch is correct.

Oct 4 2018, 11:45 AM

Jun 12 2018

nicholas added inline comments to D48100: Append new attributes to the end of an AttributeList..
Jun 12 2018, 3:33 PM

May 21 2018

nicholas added inline comments to D46814: [InstCombine] Fold unfolded masked merge pattern with variable mask!.
May 21 2018, 4:03 PM

Jan 2 2018

nicholas committed rC321665: Suppress undefined-template warnings when the pattern is declared in a system….
Suppress undefined-template warnings when the pattern is declared in a system…
Jan 2 2018, 11:11 AM
nicholas committed rL321665: Suppress undefined-template warnings when the pattern is declared in a system….
Suppress undefined-template warnings when the pattern is declared in a system…
Jan 2 2018, 11:11 AM

Jun 12 2017

nicholas committed rL305239: Revert r301742 which made ExprConstant checking apply to all full-exprs..
Revert r301742 which made ExprConstant checking apply to all full-exprs.
Jun 12 2017, 3:00 PM
nicholas committed rL305233: Revert r303316, a change to ExprConstant to evaluate function arguments..
Revert r303316, a change to ExprConstant to evaluate function arguments.
Jun 12 2017, 2:16 PM

May 17 2017

nicholas committed rL303317: The constant expression evaluator should examine function arguments for non….
The constant expression evaluator should examine function arguments for non…
May 17 2017, 5:10 PM

May 1 2017

nicholas committed rL301891: Revert r301785 (and r301787) because they caused PR32864..
Revert r301785 (and r301787) because they caused PR32864.
May 1 2017, 6:19 PM

Apr 30 2017

nicholas committed rL301787: Fix test that was incorrected merged between patches..
Fix test that was incorrected merged between patches.
Apr 30 2017, 7:33 PM
nicholas committed rL301785: Handle expressions with non-literal types like ignored expressions if we are….
Handle expressions with non-literal types like ignored expressions if we are…
Apr 30 2017, 7:16 PM

Apr 29 2017

nicholas committed rL301742: Remove Sema::CheckForIntOverflow, and instead check all full-expressions..
Remove Sema::CheckForIntOverflow, and instead check all full-expressions.
Apr 29 2017, 2:47 AM

Apr 28 2017

nicholas committed rL301721: ObjCBoxedExpr can't be evaluated by the constant expression evaluator..
ObjCBoxedExpr can't be evaluated by the constant expression evaluator.
Apr 28 2017, 5:20 PM

Apr 27 2017

nicholas committed rL301522: In the expression evaluator, visit the index of an ArraySubscriptExpr even if….
In the expression evaluator, visit the index of an ArraySubscriptExpr even if…
Apr 27 2017, 12:40 AM
nicholas committed rL301520: In the expression evaluator, descend into both the true and false expressions….
In the expression evaluator, descend into both the true and false expressions…
Apr 27 2017, 12:24 AM