Page MenuHomePhabricator

ahatanak (Akira Hatanaka)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 4 2013, 1:37 PM (384 w, 2 h)

Recent Activity

Tue, Apr 6

ahatanak accepted D99946: [DebugInfo] Fix DWARF expressions for __block vars that are not on the heap.

LGTM, but you can wait for the final approval from @aprantl.

Tue, Apr 6, 10:38 AM · Restricted Project

Thu, Apr 1

ahatanak accepted D99661: [SemaObjC] Fix a -Wbridge-cast false-positive.

I agree with you. If it's not going to work, maybe there should have been a warning.

Thu, Apr 1, 4:55 PM · Restricted Project

Wed, Mar 31

ahatanak added a comment to D99661: [SemaObjC] Fix a -Wbridge-cast false-positive.

I see a warning when I compile the following (contrived) example:

Wed, Mar 31, 3:44 PM · Restricted Project

Mon, Mar 22

ahatanak added a comment to D94597: [X86] Lower calls with clang.arc.attachedcall bundle.
In D94597#2632806, @ab wrote:

I read through the discussion in D92808 but it sounds like that predates the x86_64-specific behavior, right? But skimming around the various passes involved I'm not actually sure who emits the retainARV/claimARV calls on aarch64.

On AArch64 I think that happens during the lowering of the ARC intrinsics pre-ISel, but @ahatanak would know more about the exact place.

Mon, Mar 22, 9:31 AM · Restricted Project

Mar 9 2021

ahatanak added a comment to rGa2a55def354d: Move llvm/Analysis/ObjCARCUtil.h to IR to fix layering..

Moved the header back in dca5737945b9a52d0c66c7ec0cbaa2e15ada69cf

Mar 9 2021, 8:00 AM

Mar 8 2021

ahatanak committed rGdca5737945b9: Move ObjCARCUtil.h back to llvm/Analysis (authored by ahatanak).
Move ObjCARCUtil.h back to llvm/Analysis
Mar 8 2021, 4:36 PM
ahatanak added a comment to rGa2a55def354d: Move llvm/Analysis/ObjCARCUtil.h to IR to fix layering..

I'll move the header back to Analysis.

Mar 8 2021, 4:23 PM

Mar 4 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Thanks! Reapplied the patch in https://github.com/llvm/llvm-project/commit/1900503595cbb84a4c6e140a9ba1a2c574c0586d

Mar 4 2021, 11:37 AM · Restricted Project, Restricted Project
ahatanak committed rG1900503595cb: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of (authored by ahatanak).
[ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of
Mar 4 2021, 11:23 AM

Mar 3 2021

ahatanak updated the diff for D97824: [ObjC][ARC] Don't add operand bundle `clang.arc.attachedcall` to a call if the call already has the operand bundle.

Emit a call to @llvm.objc.retain instead of a call to @llvm.objc.retainAutoreleasedReturnValue.

Mar 3 2021, 12:25 PM · Restricted Project
ahatanak planned changes to D97824: [ObjC][ARC] Don't add operand bundle `clang.arc.attachedcall` to a call if the call already has the operand bundle.

On second thought, I think we should emit a call to @llvm.objc.retain instead of a call to @llvm.objc.retainAutoreleasedReturnValue. I think we might want to remove ARC optimizer's code that converts calls to @llvm.objc.retainAutoreleasedReturnValue to calls to @llvm.objc.retain since it sometimes does the transformation when it shouldn't and we won't need that transformation once we switch to using the clang.arc.attachedcall operand bundle.

Mar 3 2021, 11:31 AM · Restricted Project

Mar 2 2021

ahatanak added a comment to D97824: [ObjC][ARC] Don't add operand bundle `clang.arc.attachedcall` to a call if the call already has the operand bundle.

We could emit a call to @llvm.objc.retain instead of the call to @llvm.objc.retainAutoreleasedReturnValue, but this doesn't seem to happen often and ARC optimizer can remove or replace the call anyway, so I'm just letting the front-end emit @llvm.objc.retainAutoreleasedReturnValue for simplicity.

Mar 2 2021, 5:58 PM · Restricted Project
ahatanak requested review of D97824: [ObjC][ARC] Don't add operand bundle `clang.arc.attachedcall` to a call if the call already has the operand bundle.
Mar 2 2021, 5:50 PM · Restricted Project

Feb 28 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

FYI, we're seeing test failures caused by this patch in iOS/arm64 builds when arc is used (simulator is fine though): https://bugs.chromium.org/p/chromium/issues/detail?id=1182642#c11

We'll try to investigate a bit more on our side, but I wanted to give an early(ish) heads-up in case others see this or whatnot.

Not sure if this landed before or after the 12.0 branch.

Feb 28 2021, 7:40 PM · Restricted Project, Restricted Project

Feb 25 2021

ahatanak committed rGec4408ad692b: [CodeGen] Call ConvertTypeForMem instead of ConvertType (authored by ahatanak).
[CodeGen] Call ConvertTypeForMem instead of ConvertType
Feb 25 2021, 12:12 PM
ahatanak added inline comments to D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function..
Feb 25 2021, 9:21 AM · Restricted Project

Feb 22 2021

ahatanak added a comment to D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

I managed to reproduce the failure by building everything with -DLLVM_APPEND_VC_REV=NO.

Feb 22 2021, 6:01 PM · Restricted Project

Feb 18 2021

ahatanak added a comment to D89903: [CodeGen] Crash instead of generating broken code with self-capturing __block var.

OK, I se the other patch is using the bit.

Feb 18 2021, 2:10 PM · Restricted Project
ahatanak added a comment to D89903: [CodeGen] Crash instead of generating broken code with self-capturing __block var.

VarDecl has a bit (EscapingByref) that indicates whether the __block variable is captured by an escaping block. Can that information be used to avoid pre-moving to the heap?

Feb 18 2021, 2:03 PM · Restricted Project
ahatanak added a comment to D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

I still don't understand why the test was failing, but did we have to bump the version because a new LangOpt (EncodeCXXClassTemplateSpec) was added?

Feb 18 2021, 12:35 PM · Restricted Project
ahatanak added a comment to D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

Very cool change, I wanted something like this for a long time :)

It seems to break Index/preamble-reparse-changed-module.m on some platforms:
http://45.33.8.238/linux/39727/step_7.txt
http://45.33.8.238/macm1/3788/step_6.txt

Does the failure make sense to you?

Feb 18 2021, 11:05 AM · Restricted Project
ahatanak committed rGb87a12082098: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string (authored by ahatanak).
[ObjC] Encode pointers to C++ classes as "^v" if the encoded string
Feb 18 2021, 9:39 AM
ahatanak closed D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .
Feb 18 2021, 9:38 AM · Restricted Project
ahatanak updated the diff for D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .
  • Use BoolFOption to define both the positive and negative options.
  • Enable the optimization if the ObjC runtime is a NeXT-family runtime.
Feb 18 2021, 7:29 AM · Restricted Project

Feb 17 2021

ahatanak updated the diff for D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

Add test cases for nested class.

Feb 17 2021, 11:45 PM · Restricted Project
ahatanak added inline comments to D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function..
Feb 17 2021, 9:28 PM · Restricted Project
ahatanak updated the diff for D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

Upload patch with context.

Feb 17 2021, 9:23 PM · Restricted Project
ahatanak updated the diff for D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

Enable this optimization only on Darwin.

Feb 17 2021, 9:17 PM · Restricted Project
ahatanak added a comment to D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function..

It was explicitly disallowed in the initial patch: https://reviews.llvm.org/D12922 and the original author said "I'm still trying to figure out the best way to handle c++ virtual functions: this attribute is not very useful for someone who is looking for a way to reliably prevent tail-call to a virtual function." and "I made this change because this attribute isn't useful when the compiler cannot resolve the function call statically at compile time and it isn't important for the use case I have." Has this situation changed in the backend?

Oh, I didn't see that. But when I tested not_tail_called on normal functions, it seems like not working(https://godbolt.org/z/znr5b5, f1 is marked as not_tail_called, it still get inlined). Or, I misunderstand how to use it properly?

I'm still trying to remember the discussions we had, but I think we banned the attribute on virtual functions because you can't in general promise a call to an annotated function won't be tail called if the function is virtual.

This patch doesn't prevent the call to method in the code below from being tail called, but I suppose users would except the attribute to prevent the tail call?

struct B {
  virtual void method();  
};

struct D : B {
  [[clang::not_tail_called]] void method() override; 
};

void test(D *d) {
  B *b = D;
  b->method();
}

I got the point about why preventing it on virtual functions. But, on the above godbolt link, I provided a example where not_tail_called doesn't prevent a non-virtual function from tail call. I wonder if I use it correctly.

Feb 17 2021, 4:28 PM · Restricted Project
ahatanak added a comment to D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function..

It was explicitly disallowed in the initial patch: https://reviews.llvm.org/D12922 and the original author said "I'm still trying to figure out the best way to handle c++ virtual functions: this attribute is not very useful for someone who is looking for a way to reliably prevent tail-call to a virtual function." and "I made this change because this attribute isn't useful when the compiler cannot resolve the function call statically at compile time and it isn't important for the use case I have." Has this situation changed in the backend?

Oh, I didn't see that. But when I tested not_tail_called on normal functions, it seems like not working(https://godbolt.org/z/znr5b5, f1 is marked as not_tail_called, it still get inlined). Or, I misunderstand how to use it properly?

Feb 17 2021, 3:45 PM · Restricted Project

Feb 16 2021

ahatanak added a comment to D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .

This patch focuses only on reducing the encoded size of classes with template specialization, but if the information about pointed-to types isn't used at all, clang can always emit "^v" for C++ pointer types. Or it might make more sense to base the decision on whether the type is POD rather than on whether the string includes template specialization.

Feb 16 2021, 3:03 PM · Restricted Project
ahatanak requested review of D96816: [ObjC] Encode pointers to C++ classes as "^v" if the encoded string would otherwise include template specialization types .
Feb 16 2021, 2:11 PM · Restricted Project

Feb 15 2021

ahatanak committed rG32dc79c5efed: [ObjC][ARC] Do not perform code motion on precise release calls (authored by ahatanak).
[ObjC][ARC] Do not perform code motion on precise release calls
Feb 15 2021, 5:40 PM

Feb 12 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Thanks! I didn't realize it hadn't been fixed in the patch I committed.

Feb 12 2021, 12:36 PM · Restricted Project, Restricted Project
ahatanak committed rGed4718eccb12: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of (authored by ahatanak).
[ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of
Feb 12 2021, 9:52 AM
ahatanak closed D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Feb 12 2021, 9:52 AM · Restricted Project, Restricted Project

Feb 11 2021

ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
  • Renamed the operand bundle name to clang.arc.attachedcall. I also tried to pass the address of the ARC function as the argument, but the verifier doesn't allow taking addresses of intrinsics.
Feb 11 2021, 8:58 PM · Restricted Project, Restricted Project
ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Another thing I noticed that there's verifier support missing. I think we should at least check that only a single clang.arc.rv bundle is specified (https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Verifier.cpp#L3191). We should probably also enforce that the bundle is only provided for functions with an i8* return type. That can also be done after the main patch lands.

Feb 11 2021, 12:00 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Address all review comments except for the ones about the bundle name.

Feb 11 2021, 11:54 AM · Restricted Project, Restricted Project
ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

For example, if SCCP just does a normal RAUW on the following call, which is taken from the example I posted,

%r = call i8* @foo() [ "clang.arc.rv"(i64 1, i8* %r) ]

will become

%r = call i8* @foo() [ "clang.arc.rv"(i64 1, i8* @g0) ]

%r doesn't have an explicit use in the IR anymore, so passes like deadargelim can change the return type of the function to void.

Is that a problem? It seems like this keeps all the information ARC needs. This could be lowered to:

call void @foo()
call @unsafeClaimAutoreleasedReturnValue(i8* @g0)

The ARC optimizer and ARC lowering both need to know about this case, but I don't see why deadargelim needs to know anything special.

Feb 11 2021, 11:50 AM · Restricted Project, Restricted Project

Feb 10 2021

ahatanak requested review of D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Feb 10 2021, 5:42 PM · Restricted Project, Restricted Project
ahatanak reopened D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

The ultimate code-generation consequences of this feature aren't very generic, so we shouldn't let ourselves get caught up designing an extremely general feature that ultimately either doesn't do what we need it to do or doesn't actually work for any of the generalizations.

Sure, those are two bad potential outcomes.

Stepping back, the goal of this patch is to encode ARC's code generation invariants in the IR so that maintainers don't inadvertently break them. I think the IR should describe those invariants as clearly and precisely as is reasonable.

Besides idle / misplaced optimism about reuse, I was trying to make the following points along those lines, so I'll restate them more directly:

  • Explicitly adding a use of the call avoids having to teach transformations / analyses about it. It might be simpler to add a self-reference carve-out for this operand bundle (or operand bundles in general) than to teach all the passes that this operand bundle implies a use of the callsite (but I'm not sure; maybe there are lots of assumptions about self-references not existing outside of PHIs...).
  • Passing the function that's implicitly called into the operand bundle is simpler to reason about than an opaque table index.
  • Naming the operand bundle after its code generation consequences makes it simpler reason about. (A few generic names that make some sense to me (besides what I listed yesterday) include "callafter", "callimmediately", "forwardto", and "attachedcall". If it's important to make this ARC only, it could be (e.g.) "clang.arc.attachedcall".)
Feb 10 2021, 5:41 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Fix two bugs which were discovered.

Feb 10 2021, 5:20 PM · Restricted Project, Restricted Project

Feb 9 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

This patch causes opt to crash when the following IR is compiled:

Feb 9 2021, 11:33 AM · Restricted Project, Restricted Project
ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

It looks like there is a pre-existing bug in replaceUsesOfNonProtoConstant where the operand bundles of all call sites are accumulated into newBundles. This will be fixed if its declaration is moved into the loop body. Also, we found another case of deadargelim changing the return type of the called function to void. I'll post a new patch when I have the fixes.

Feb 9 2021, 10:05 AM · Restricted Project, Restricted Project

Feb 8 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

I do have a plan to modify the auto upgrader to use the bundles when it's possible to do so, but I'm currently not considering landing the changes I reverted since they were only needed to avoid duplicating constant strings. I don't think we can avoid duplicating the string unless objcarc::getRVMarkerModuleFlagStr() can be moved to a file in llvm/include/llvm/IR.

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

Feb 5 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

I ended up reverting the changes I made to llvm/lib/IR/AutoUpgrade.cpp as the file was including llvm/Analysis/ObjCARCUtil.h, which was violating layering.

Feb 5 2021, 12:08 PM · Restricted Project, Restricted Project
ahatanak committed rG4a64d8fe3924: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly (authored by ahatanak).
[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly
Feb 5 2021, 6:10 AM
ahatanak added a reverting change for rG3fe3946d9a95: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly: rG2fbbb18c1dbe: Revert "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly".
Feb 5 2021, 6:02 AM
ahatanak committed rG2fbbb18c1dbe: Revert "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly" (authored by ahatanak).
Revert "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly"
Feb 5 2021, 6:02 AM
ahatanak added a reverting change for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR: rG2fbbb18c1dbe: Revert "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly".
Feb 5 2021, 6:02 AM · Restricted Project, Restricted Project
ahatanak committed rG3fe3946d9a95: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly (authored by ahatanak).
[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly
Feb 5 2021, 5:56 AM
ahatanak closed D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Feb 5 2021, 5:55 AM · Restricted Project, Restricted Project

Feb 3 2021

ahatanak committed rGaade0ec23b59: Fix the guaranteed alignment of memory returned by malloc/new on Darwin (authored by ahatanak).
Fix the guaranteed alignment of memory returned by malloc/new on Darwin
Feb 3 2021, 7:41 PM
ahatanak closed D95910: Fix the guaranteed alignment of memory returned by malloc/new on Darwin.
Feb 3 2021, 7:41 PM · Restricted Project
ahatanak updated the diff for D95910: Fix the guaranteed alignment of memory returned by malloc/new on Darwin.

Make the alignment 16 bytes on 32-bit systems too.

Feb 3 2021, 3:57 PM · Restricted Project

Feb 2 2021

ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Add a description of the new bundle to LangRef.

Feb 2 2021, 8:59 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Address review comments.

Feb 2 2021, 5:33 PM · Restricted Project, Restricted Project
ahatanak requested review of D95910: Fix the guaranteed alignment of memory returned by malloc/new on Darwin.
Feb 2 2021, 5:31 PM · Restricted Project

Feb 1 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

We could run another pass to clean up the IR after inlining, but I think it's better to do the cleanup right after the callee function is cloned in the caller function.

Feb 1 2021, 7:46 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Address review comments.

Feb 1 2021, 7:42 PM · Restricted Project, Restricted Project

Jan 28 2021

ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Teach markTails to ignore operand bundle clang.arc.rv when determining whether a call can be marked as tail. ObjCARCOpt::OptimizeReturn cannot eliminate the retainRV/autoreleaseRV pair if the call isn't marked as tail.

Jan 28 2021, 4:59 PM · Restricted Project, Restricted Project

Jan 27 2021

ahatanak requested review of D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 27 2021, 5:06 PM · Restricted Project, Restricted Project
ahatanak reopened D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Address post-commit review comments.

Jan 27 2021, 5:06 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 27 2021, 5:03 PM · Restricted Project, Restricted Project

Jan 26 2021

ahatanak added inline comments to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 26 2021, 2:11 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 26 2021, 7:17 AM · Restricted Project, Restricted Project

Jan 25 2021

ahatanak committed rG53176c168061: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV (authored by ahatanak).
[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV
Jan 25 2021, 11:57 AM
ahatanak closed D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 25 2021, 11:57 AM · Restricted Project, Restricted Project

Jan 22 2021

ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Stop using clang.arc.rv_marker and just use "clang.arc.rv"="retain/claim".

Jan 22 2021, 12:07 PM · Restricted Project, Restricted Project
ahatanak added inline comments to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 22 2021, 9:53 AM · Restricted Project, Restricted Project

Jan 21 2021

ahatanak committed rG3d349ed7e110: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver (authored by ahatanak).
[CodeGen][ObjC] Fix broken IR generated when there is a nil receiver
Jan 21 2021, 5:39 PM
ahatanak closed D95181: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver check.
Jan 21 2021, 5:39 PM · Restricted Project
ahatanak updated the diff for D95181: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver check.

Add a test for invoke and a FIXME for eliminating the need for emitARCOperationAfterCall.

Jan 21 2021, 5:36 PM · Restricted Project
ahatanak requested review of D95181: [CodeGen][ObjC] Fix broken IR generated when there is a nil receiver check.
Jan 21 2021, 3:05 PM · Restricted Project
ahatanak added inline comments to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.
Jan 21 2021, 2:52 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Update patch.

Jan 21 2021, 12:01 PM · Restricted Project, Restricted Project
ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Add helper functions to ObjCARCRVAttr.h for adding, removing, or looking up attributes.

Jan 21 2021, 11:58 AM · Restricted Project, Restricted Project

Jan 19 2021

ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

ping

Jan 19 2021, 8:47 AM · Restricted Project, Restricted Project

Jan 12 2021

ahatanak committed rGdd9557712402: Fix typo in diagnostic message (authored by ahatanak).
Fix typo in diagnostic message
Jan 12 2021, 9:59 AM

Jan 11 2021

ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Rebase and fix a few bugs in the patch.

Jan 11 2021, 11:43 AM · Restricted Project, Restricted Project

Jan 8 2021

ahatanak added a comment to D93743: [NewPM] Run ObjC ARC passes.

OK, I see.

Jan 8 2021, 3:42 PM · Restricted Project, Restricted Project
ahatanak accepted D93743: [NewPM] Run ObjC ARC passes.

LGTM. ARC contract pass isn't being run by the NPM, but you are going to change that in the future, I guess?

Jan 8 2021, 3:10 PM · Restricted Project, Restricted Project

Jan 7 2021

ahatanak added a comment to D93743: [NewPM] Run ObjC ARC passes.

Is this change safe considering calls to EP.get() can add function declarations to the module as you mentioned in https://reviews.llvm.org/D86178?

Jan 7 2021, 5:39 PM · Restricted Project, Restricted Project

Dec 28 2020

ahatanak committed rG34405b41d615: [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller (authored by ahatanak).
[CodeGen][ObjC] Destroy callee-destroyed arguments in the caller
Dec 28 2020, 11:53 AM
ahatanak closed D93273: [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller function when the receiver is nil.
Dec 28 2020, 11:52 AM · Restricted Project
ahatanak updated the diff for D93273: [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller function when the receiver is nil.

Make isParamDestroyedInCallee a method of ParmVarDecl.

Dec 28 2020, 11:50 AM · Restricted Project

Dec 18 2020

ahatanak committed rGffd982f7db58: [ObjC][ARC] Fix a bug where the inline-asm retain/claim RV marker wasn't (authored by ahatanak).
[ObjC][ARC] Fix a bug where the inline-asm retain/claim RV marker wasn't
Dec 18 2020, 4:59 PM
ahatanak added a comment to D92361: [trivial-abi] Support types without a copy or move constructor..

We could probably do something like what this patch is doing and determine whether a class can be passed in registers based on whether its subobjects can be passed in registers. If all of the subobjects can be passed in registers, the current class can be passed in registers too unless something declared in the current class forces it to be passed indirectly (e.g., a virtual function is declared).

Dec 18 2020, 3:55 PM · Restricted Project
ahatanak added a comment to D92361: [trivial-abi] Support types without a copy or move constructor..

This latest patch changes the way D is passed in the following example, which doesn't use trivial_abi at all:

Dec 18 2020, 3:11 PM · Restricted Project

Dec 16 2020

ahatanak added inline comments to D92361: [trivial-abi] Support types without a copy or move constructor..
Dec 16 2020, 9:07 PM · Restricted Project
ahatanak added inline comments to D92361: [trivial-abi] Support types without a copy or move constructor..
Dec 16 2020, 2:35 PM · Restricted Project

Dec 14 2020

ahatanak requested review of D93273: [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller function when the receiver is nil.
Dec 14 2020, 9:20 PM · Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Set the insert point before generating new instructions in insertRetainOrClaimRVCalls.

Dec 14 2020, 11:42 AM · Restricted Project, Restricted Project

Dec 10 2020

ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Rebase.

Dec 10 2020, 7:07 PM · Restricted Project, Restricted Project

Dec 9 2020

ahatanak updated the diff for D78760: Check a class doesn't have a dependent type before iterating over its base classes.

Rebase and ping.

Dec 9 2020, 5:31 PM · Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Elaborate on when createCallInstWithColors should be called.

Dec 9 2020, 4:24 PM · Restricted Project, Restricted Project
ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

ToT clang/llvm (without this patch) is turning the call to @objc_unsafeClaimAutoreleasedReturnValue in the EH cleanup block into an unreachable when compiling the following code. It looks like this happens because the inliner isn't adding the funclet token, but it's not clear to me whether this is a bug or not.

Dec 9 2020, 4:05 PM · Restricted Project, Restricted Project
ahatanak updated the diff for D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Enable the optimization on Windows.

Dec 9 2020, 3:55 PM · Restricted Project, Restricted Project
ahatanak added a comment to D92808: [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of explicitly emitting retainRV or claimRV calls in the IR.

Hmm, it seems that calls to some of the ARC runtime functions don't get the token. In some cases, I'm seeing WinEHPrepare (ToT clang, without this patch) turn a call to @objc_unsafeClaimAutoreleasedReturnValue in an EH cleanup block into an unreachable.

Dec 9 2020, 11:57 AM · Restricted Project, Restricted Project