Page MenuHomePhabricator
Feed Advanced Search

Yesterday

reames reopened D99976: Allow invokable sub-classes of IntrinsicInst.
Tue, Apr 20, 3:48 PM · Restricted Project
reames added a comment to D99976: Allow invokable sub-classes of IntrinsicInst.

(For anyone following along, discussion has moved to email on review thread which phabricator isn't catching.)

Tue, Apr 20, 3:40 PM · Restricted Project
reames added a reverting change for rGd87b9b81ccb9: Allow invokable sub-classes of IntrinsicInst: rG4824d876f00a: Revert "Allow invokable sub-classes of IntrinsicInst".
Tue, Apr 20, 3:39 PM
reames committed rG4824d876f00a: Revert "Allow invokable sub-classes of IntrinsicInst" (authored by reames).
Revert "Allow invokable sub-classes of IntrinsicInst"
Tue, Apr 20, 3:39 PM
reames added a reverting change for D99976: Allow invokable sub-classes of IntrinsicInst: rG4824d876f00a: Revert "Allow invokable sub-classes of IntrinsicInst".
Tue, Apr 20, 3:38 PM · Restricted Project
reames added a comment to D99976: Allow invokable sub-classes of IntrinsicInst.

I guess my question is "why? what does this make easier/harder/etc?"

A couple of pieces here.

  1. We no longer have the chance of a nasty false negative bug. Before, we could fail to handle some intrinsics because they would not match IntrinsicInst.
  2. As listed in the potential cleanups in the commit, we have multiple places in code which handled intrinsics generically, but then had to add extra casing for the invokable ones. We'll be able to clean that up.
  3. For intrinsics which really are calls - which, admittedly, is many - this does complicate the pattern matching as you have to both match the intrinsicinst, and then cast to CallInst for interfaces which expect calls. (A quick survey shows many of those interfaces could reasonably take CallBase, but not all.) We could explore having two base classes - one for all intrinsics and one for call only intrinsics - not quite sure if the multiple inheritance works out there. It didn't seem worthwhile to justify exploration to me, if you disagree, let me know.
Tue, Apr 20, 3:28 PM · Restricted Project
reames added a comment to D100884: Generalize getInvertibleOperand to support mismatched phi operand order.

I don't think this is particularly valuable in terms of optimization power, but I do think the interface makes a bit more sense that way. Though I would suggest to go one step further and return std::pair<Value *, Value *>. That is, for a pair of input values, it returns a pair of output values that preserve the equality relationship. This should make the phi case particularly nice, because you can simply return {Start1, Start2} rather than checking for different possibilities of operand orders.

I played with this, but it turns out a bit more ugly than it sounds. It requires a bunch of duplicated boilerplate for the non-phi return points, and more importantly, greatly complicates the check to see that the recurrence is the LHS of the operation. I really didn't care for the resulting code structure.

Tue, Apr 20, 3:08 PM · Restricted Project
reames committed rGd87b9b81ccb9: Allow invokable sub-classes of IntrinsicInst (authored by reames).
Allow invokable sub-classes of IntrinsicInst
Tue, Apr 20, 3:06 PM
reames closed D99976: Allow invokable sub-classes of IntrinsicInst.
Tue, Apr 20, 3:06 PM · Restricted Project
reames requested review of D100884: Generalize getInvertibleOperand to support mismatched phi operand order.
Tue, Apr 20, 1:12 PM · Restricted Project
reames committed rG6792e26c0d0f: Reapply "Look through invertible recurrences in isKnownNonEqual" (authored by reames).
Reapply "Look through invertible recurrences in isKnownNonEqual"
Tue, Apr 20, 12:48 PM
reames added inline comments to D99912: Look through invertible recurrences in isKnownNonEqual.
Tue, Apr 20, 11:59 AM · Restricted Project
reames added a reverting change for rGbe20eae25f50: Look through invertible recurrences in isKnownNonEqual: rG3b6acb179708: Revert "Look through invertible recurrences in isKnownNonEqual".
Tue, Apr 20, 11:48 AM
reames committed rG3b6acb179708: Revert "Look through invertible recurrences in isKnownNonEqual" (authored by reames).
Revert "Look through invertible recurrences in isKnownNonEqual"
Tue, Apr 20, 11:48 AM
reames added a reverting change for D99912: Look through invertible recurrences in isKnownNonEqual: rG3b6acb179708: Revert "Look through invertible recurrences in isKnownNonEqual".
Tue, Apr 20, 11:48 AM · Restricted Project
reames updated the diff for D99687: [SCEV] Compute ranges for lshr recurrences.

Rebase over requested tests, and narrow initial scope to lshr only. Will return to ashr once this lands.

Tue, Apr 20, 11:45 AM · Restricted Project
reames committed rG9c1a145aeb1b: Rearrange code to reduce diff for D99687 [nfc] (authored by reames).
Rearrange code to reduce diff for D99687 [nfc]
Tue, Apr 20, 11:41 AM
reames added a comment to D99687: [SCEV] Compute ranges for lshr recurrences.

I couldn't find tests for the following scenarios:

  • Saturated ashr for positive & negative start;

test_ashr_tc_positive and test_ashr_tc_negative - not that 128 is INT_MIN for i8

Tue, Apr 20, 11:40 AM · Restricted Project
reames committed rG1668ace94813: [tests] Expand coverage for D99687 (authored by reames).
[tests] Expand coverage for D99687
Tue, Apr 20, 11:32 AM
reames committed rGbe20eae25f50: Look through invertible recurrences in isKnownNonEqual (authored by reames).
Look through invertible recurrences in isKnownNonEqual
Tue, Apr 20, 10:52 AM
reames closed D99912: Look through invertible recurrences in isKnownNonEqual.
Tue, Apr 20, 10:52 AM · Restricted Project
reames requested changes to D99926: [GVN] Introduce loop load PRE.

LGTM withdrawn due to issue noticed by Nikita. Please address and refresh.

Tue, Apr 20, 10:51 AM · Restricted Project
reames added a comment to D99976: Allow invokable sub-classes of IntrinsicInst.

ping

Tue, Apr 20, 10:46 AM · Restricted Project
reames added reviewers for D99976: Allow invokable sub-classes of IntrinsicInst: nikic, fhahn, echristo, jyknight.
Tue, Apr 20, 10:45 AM · Restricted Project
reames abandoned D100004: [SCEV] Correct handling of recurrences matched in partially unreachable code (try 2).

I prototyped a couple of alternatives to this, and the resulting interface in matchSimpleRecurrence is ugly and error prone. Based on a survey of the existing users, SCEV is the only place which cares about the mismatch between LoopInfo and reachability.

Tue, Apr 20, 10:44 AM · Restricted Project
reames committed rG72f3f6713710: [test] Add a couple extra tests for recurrence matching in unreachable code (authored by reames).
[test] Add a couple extra tests for recurrence matching in unreachable code
Tue, Apr 20, 10:09 AM
reames updated the diff for D99912: Look through invertible recurrences in isKnownNonEqual.

Rebase over a couple added tests to cover cases which caused reviewer confusion. (For good cause.)

Tue, Apr 20, 10:01 AM · Restricted Project
reames committed rG07b004998a0c: [test] Add a couple more tests for D99912 (authored by reames).
[test] Add a couple more tests for D99912
Tue, Apr 20, 9:57 AM
reames updated the diff for D99912: Look through invertible recurrences in isKnownNonEqual.

Rebase over requested test changes - thanks btw, good catch.

Tue, Apr 20, 9:48 AM · Restricted Project
reames committed rG3b7f6fd26d3e: [tests] Update per review comment on D99912 (authored by reames).
[tests] Update per review comment on D99912
Tue, Apr 20, 9:43 AM
reames accepted D99926: [GVN] Introduce loop load PRE.

LGTM w/minor comments.

Tue, Apr 20, 9:18 AM · Restricted Project
reames committed rG3b1474cab26b: free(nullptr) does not violate the nofree specification (authored by reames).
free(nullptr) does not violate the nofree specification
Tue, Apr 20, 9:08 AM
reames closed D100779: free(nullptr) does not violate the nofree specification.
Tue, Apr 20, 9:08 AM · Restricted Project

Mon, Apr 19

reames committed rG3c54762226ed: [funcattrs] Consistently check call site attributes (authored by reames).
[funcattrs] Consistently check call site attributes
Mon, Apr 19, 1:21 PM
reames closed D100689: [funcattrs] Consistently check call site attributes.
Mon, Apr 19, 1:21 PM · Restricted Project
reames added a comment to D99802: [rs4gc] Strip memory related attributes consistently.

I landed a change (01801d5274) which should address the reported issue. (It was essentially a latent bug in the existing code.)

Mon, Apr 19, 1:15 PM · Restricted Project
reames committed rG01801d527410: [rs4gc] Fix a latent bug around attribute stripping for intrinsics (authored by reames).
[rs4gc] Fix a latent bug around attribute stripping for intrinsics
Mon, Apr 19, 1:14 PM
reames added a comment to D96349: [instcombine] Exploit UB implied by nofree attributes.

FYI, there was a nasty bug found in this patch. A fix is on review in https://reviews.llvm.org/D100779.

Mon, Apr 19, 11:29 AM · Restricted Project
reames added a comment to D100141: [nofree] Restrict semantics to memory visible to caller.

Proposed fix for the issue Nuno found here: https://reviews.llvm.org/D100779

Mon, Apr 19, 11:28 AM · Restricted Project
reames requested review of D100779: free(nullptr) does not violate the nofree specification.
Mon, Apr 19, 11:24 AM · Restricted Project
reames committed rG89a93889daa1: Update a test for auto-update format change (authored by reames).
Update a test for auto-update format change
Mon, Apr 19, 11:15 AM
reames added a comment to D100141: [nofree] Restrict semantics to memory visible to caller.

I've updated Alive2 with the new semantics and I see one regression:

Ok, wow. Thank you!

Mon, Apr 19, 10:35 AM · Restricted Project
reames added inline comments to D100706: [LICM] Make capture check more precise.
Mon, Apr 19, 10:24 AM · Restricted Project
reames added a comment to D100676: [nofree] Attempt to further refine concurrency/capture requirements.

I think the crux of the discussion is the second half of this sentence:

A nofree function is explicitly allowed to free memory which it (or a transitive callee) allocated or (if not nosync) arrange for another thread to free memory on its behalf.

I'm trying to figure out whether that second half makes sense by analogy with other attributes. For example, consider a function that is inaccessiblememonly. Is such a function allowed to use the inaccessible memory to communicate with another thread which then touches memory that is accessible to the caller? I'm pretty sure the assumption in existing LLVM code is that the answer is "no".

The honest truth is that our concurrency specification, and in particular, how it interacts with attributes is lacking to say the least.

Mon, Apr 19, 10:21 AM · Restricted Project
reames added a comment to D100663: [LV] Add undef incoming value to loop-exit phis for the middle-block..

Thanks for taking a look and apologies for not doing a good job at conveying my thinking. My rational was that at the point we add the undef incoming value, it is yet undetermined which edge will be taken, so SCEV will constrain the undef value, but only to the incoming value of the scalar loop. In the final IR, both incoming values should result in the same value at runtime. Does that make sense or am I still missing something?

I see where you're going here (assuming the fix you mention after this in your long comment), and this could maybe be made to work, but I'm still nervous.

Mon, Apr 19, 9:57 AM · Restricted Project
reames accepted D100706: [LICM] Make capture check more precise.

LGTM w/one suggested comment.

Mon, Apr 19, 9:36 AM · Restricted Project
reames accepted D100020: [GreedyRA ORE] Add Cost of spill locations into remark.

LGTM w/required changes.

Mon, Apr 19, 9:27 AM · Restricted Project
reames added a comment to D100551: [deref] No need to check nosync in addition to nofree.

I am really curious how you stumbled into this? There's only one currently enabled case which uses this codepath, and it has an explicit check for the GC abstract machine model which should cover your use case as I understand it?

I am planning to use this checker for loop load PRE. In case of concurrent GC, this check is too restrictive because nosync is never inferrable in practice.

Max, it might be worth talking offline about the specifics of your case.

Mon, Apr 19, 9:09 AM · Restricted Project
reames added inline comments to D100689: [funcattrs] Consistently check call site attributes.
Mon, Apr 19, 9:04 AM · Restricted Project

Fri, Apr 16

reames committed rG11707435ccb4: [inferattrs] Don't infer lib func attributes for nobuiltin functions (authored by reames).
[inferattrs] Don't infer lib func attributes for nobuiltin functions
Fri, Apr 16, 3:37 PM
reames retitled D100689: [funcattrs] Consistently check call site attributes from [funcattrs] Consistent check call site attributes to [funcattrs] Consistently check call site attributes.
Fri, Apr 16, 2:53 PM · Restricted Project
reames requested review of D100689: [funcattrs] Consistently check call site attributes.
Fri, Apr 16, 2:53 PM · Restricted Project
reames committed rGf549176ad976: [funcattrs] Add the maximal set of implied attributes to definitions (authored by reames).
[funcattrs] Add the maximal set of implied attributes to definitions
Fri, Apr 16, 2:22 PM
reames closed D100226: [funcattrs] Add the maximal set of implied attributes to definitions.
Fri, Apr 16, 2:22 PM · Restricted Project, Restricted Project
reames abandoned D97054: [MachineVerifier] Confirm that both ends of a tied def/use are live together.

Abandoning change. I still think this is valuable, but I think it's also clear I don't have the necessary background knowledge to drive this. If anyone else wants to pick this up, feel free.

Fri, Apr 16, 1:49 PM · Restricted Project
reames accepted D100017: [GreedyRA ORE] Add stats for copy of virtual registers..

LGTM

Fri, Apr 16, 1:47 PM · Restricted Project
reames requested changes to D99926: [GVN] Introduce loop load PRE.

Looks close to ready for an LGTM if you're willing to split patch as suggested.

Fri, Apr 16, 1:41 PM · Restricted Project
reames added a comment to D100226: [funcattrs] Add the maximal set of implied attributes to definitions.

ping

Fri, Apr 16, 11:58 AM · Restricted Project, Restricted Project
reames added a comment to D100141: [nofree] Restrict semantics to memory visible to caller.

Posted https://reviews.llvm.org/D100676 with an attempt to clarifying the nocapture case raised in my response to @nhaehnle above.

Fri, Apr 16, 11:56 AM · Restricted Project
reames requested review of D100676: [nofree] Attempt to further refine concurrency/capture requirements.
Fri, Apr 16, 11:55 AM · Restricted Project
reames committed rGff55d01a8e1b: [nofree] Restrict semantics to memory visible to caller (authored by reames).
[nofree] Restrict semantics to memory visible to caller
Fri, Apr 16, 11:39 AM
reames closed D100141: [nofree] Restrict semantics to memory visible to caller.
Fri, Apr 16, 11:39 AM · Restricted Project
reames added a comment to D100141: [nofree] Restrict semantics to memory visible to caller.

LGTM, @nhaehnle should comment on the new wording probably.

JFYI, I don't intend to hold for @nhaehnle as the concern he raised appears orthogonal to the change being made in this review. I am happy to continue this discussion and post another patch if we thing further clarification is warranted for the concurrency case. I am leaning in that direction myself.

Fri, Apr 16, 11:32 AM · Restricted Project
reames requested changes to D100551: [deref] No need to check nosync in addition to nofree.

Change rejected. the nofree function attribute does explicitly allow freeing by another thread. See e.g. discussion here: https://reviews.llvm.org/D100141#2695360

Fri, Apr 16, 11:26 AM · Restricted Project
reames requested changes to D100559: [GC][NFC] Make getGCStrategy by name available in IR.

(Not reviewing until issue raised on previous patch addressed, please request review when that one is resolved.)

Fri, Apr 16, 11:22 AM · Restricted Project
reames added a comment to D100557: [GC][NFC] Move GCStrategy from CodeGen to IR.

Max, thank for you doing this. I think this is a really good idea.

Fri, Apr 16, 11:20 AM · Restricted Project
reames added a comment to D100141: [nofree] Restrict semantics to memory visible to caller.

@jdoerfert - Thanks for the wording suggestions; I took all of them.

Fri, Apr 16, 11:15 AM · Restricted Project
reames added a comment to D100141: [nofree] Restrict semantics to memory visible to caller.

Thank you for doing this.

The interaction with multi-threading and capturing makes me mildly nervous. Perhaps I'm just confused, but the second paragraph of the definition there seems to imply that a nofree (but not-nosync) function f is allowed to free any memory that had a pointer to it captured somewhere. But this seems to contradict the first paragraph, which says that f "does not, directly or indirectly, call a memory-deallocation function (free, for example) on a memory allocation which existed before the call."

That certainly wasn't the intent. Which bit of wording gives that impression?

Fri, Apr 16, 11:09 AM · Restricted Project
reames requested changes to D100663: [LV] Add undef incoming value to loop-exit phis for the middle-block..
Fri, Apr 16, 10:51 AM · Restricted Project
reames added a comment to D100663: [LV] Add undef incoming value to loop-exit phis for the middle-block..

This is incorrect and will result in subtle miscompiles.

Fri, Apr 16, 10:51 AM · Restricted Project

Wed, Apr 14

reames updated the diff for D100226: [funcattrs] Add the maximal set of implied attributes to definitions.

Adjust patch and description to be in line with the direction suggested by reviewer, and started in D100400.

Wed, Apr 14, 5:06 PM · Restricted Project, Restricted Project
reames added a reverting change for rGab98f2c7129a: Revert "[InferAttributes] Materialize all infered attributes for declaration": rGdd985551c247: Reapply "[InferAttributes] Materialize all infered attributes for declaration""….
Wed, Apr 14, 4:38 PM
reames added a reverting change for rG98eea392cdbc: Revert "Fix buildbots after 61a85da": rGdd985551c247: Reapply "[InferAttributes] Materialize all infered attributes for declaration""….
Wed, Apr 14, 4:38 PM
reames committed rGdd985551c247: Reapply "[InferAttributes] Materialize all infered attributes for declaration""… (authored by reames).
Reapply "[InferAttributes] Materialize all infered attributes for declaration""…
Wed, Apr 14, 4:38 PM
reames committed rGc609d5336344: Fix buildbots after 61a85da (authored by reames).
Fix buildbots after 61a85da
Wed, Apr 14, 3:16 PM
reames committed rG3ce61fb6d697: [NFC] Move a recently added utility into a location to enable reuse (authored by reames).
[NFC] Move a recently added utility into a location to enable reuse
Wed, Apr 14, 3:06 PM
reames committed rG61a85da88235: [InferAttributes] Materialize all infered attributes for declaration (authored by reames).
[InferAttributes] Materialize all infered attributes for declaration
Wed, Apr 14, 2:45 PM
reames closed D100400: [InferAttributes] Materialize all infered attributes for declaration.
Wed, Apr 14, 2:45 PM · Restricted Project
reames added a comment to D97924: [LangRef] clarify the semantics of nocapture.

Looks good to me as well.

Wed, Apr 14, 2:42 PM · Restricted Project

Tue, Apr 13

reames committed rG00c8be3f93b9: fix whitespace type (authored by reames).
fix whitespace type
Tue, Apr 13, 7:03 PM
reames added inline comments to D100004: [SCEV] Correct handling of recurrences matched in partially unreachable code (try 2).
Tue, Apr 13, 3:03 PM · Restricted Project
reames closed D99769: [funcattrs] Infer nosync from instruction walk.

Had not intended to reopen.

Tue, Apr 13, 2:56 PM · Restricted Project
reames updated the diff for D100141: [nofree] Restrict semantics to memory visible to caller.
Tue, Apr 13, 2:55 PM · Restricted Project
reames accepted D100296: [Live Intervals] Teach Greedy RA to recognize special case live-through.

LGTM w/minor comments.

Tue, Apr 13, 1:06 PM · Restricted Project
reames added a comment to D100339: [Attributor] Run lightweight version of the Attributor by default..

I hope we are on the same page now.

Provided the RFC happens *before* any version of attributor is enabled by default, yes, we are.

Tue, Apr 13, 12:22 PM · Restricted Project
reames accepted D100016: [GreedyRA ORE] Separate Folder Reloads and Zero Cost Folder Reloads.

LGTM w/one minor fix before submission.

Tue, Apr 13, 12:19 PM · Restricted Project
reames requested changes to D99926: [GVN] Introduce loop load PRE.

Comments inline include one serious correctness issue.

Tue, Apr 13, 12:11 PM · Restricted Project
reames added a comment to D97924: [LangRef] clarify the semantics of nocapture.

Minor comments, this looks like it's evolved into a reasonable step forward. As things stand, I think this should go in with some minor stuff fixed, and we can iterate on details in further patches. This is already better than what we have now. :)

Tue, Apr 13, 11:14 AM · Restricted Project
reames added inline comments to D100226: [funcattrs] Add the maximal set of implied attributes to definitions.
Tue, Apr 13, 10:56 AM · Restricted Project, Restricted Project
reames requested review of D100400: [InferAttributes] Materialize all infered attributes for declaration.
Tue, Apr 13, 10:54 AM · Restricted Project
reames committed rG6bdaf5e3413f: Remove a -O2 usage from a CSE specific test file (authored by reames).
Remove a -O2 usage from a CSE specific test file
Tue, Apr 13, 10:33 AM
reames reopened D99769: [funcattrs] Infer nosync from instruction walk.

Sorry for not replying to your points inline, phab makes that difficult for long intermixed replies.

Tue, Apr 13, 9:48 AM · Restricted Project
reames added a comment to D100339: [Attributor] Run lightweight version of the Attributor by default..

High level meta comment on enabling attributor by default, not on the code per se.

Tue, Apr 13, 9:39 AM · Restricted Project

Mon, Apr 12

reames added a comment to D100296: [Live Intervals] Teach Greedy RA to recognize special case live-through.

I really really like this idea, but the implementation, not so much. :)

Mon, Apr 12, 3:57 PM · Restricted Project
reames planned changes to D100226: [funcattrs] Add the maximal set of implied attributes to definitions.
Mon, Apr 12, 3:35 PM · Restricted Project, Restricted Project

Fri, Apr 9

reames requested review of D100226: [funcattrs] Add the maximal set of implied attributes to definitions.
Fri, Apr 9, 1:05 PM · Restricted Project, Restricted Project

Thu, Apr 8

reames abandoned D100141: [nofree] Restrict semantics to memory visible to caller.

Realized the alternative was strictly more in sync with existing code, so disregard this.

Thu, Apr 8, 2:37 PM · Restricted Project
reames requested review of D100141: [nofree] Restrict semantics to memory visible to caller.
Thu, Apr 8, 2:34 PM · Restricted Project
reames committed rG35393c865c2c: [funcattrs] Infer nosync from instruction walk (authored by reames).
[funcattrs] Infer nosync from instruction walk
Thu, Apr 8, 2:05 PM
reames closed D99769: [funcattrs] Infer nosync from instruction walk.
Thu, Apr 8, 2:05 PM · Restricted Project