Page MenuHomePhabricator
Feed Advanced Search

Sat, Feb 15

jyknight updated the diff for D74678: [libcxxabi] Replace names with single letters in test_demangle..
Sat, Feb 15, 2:19 PM · Restricted Project
jyknight created D74678: [libcxxabi] Replace names with single letters in test_demangle..
Sat, Feb 15, 2:19 PM · Restricted Project

Mon, Feb 10

jyknight added a comment to D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..

Your error looks correct to me -- "self" in a classmethod is not an instance, but the class itself. And while instances of X implement "Delegate", the Class does not.

Got it, thanks! We might need to add a flag to allow the old behavior temporarily to accommodate our codebase while it's being updated.

Mon, Feb 10, 12:45 PM · Restricted Project

Fri, Feb 7

jyknight added a comment to D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..

@jyknight @rjmccall I'm not sure this change is 100% fine. For example, the following code no longer compiles with ARC:

@protocol Delegate
@end

@interface X <Delegate>

@end

@interface Y
@property id<Delegate> d;
@end

@implementation X

+ (void)foo:(Y *)y with:(X*)x {
 y.d = self; // error: assigning to 'id<Delegate>' from incompatible type 'const Class'
 y.d = x;     // fine
}

@end
Fri, Feb 7, 7:33 AM · Restricted Project

Thu, Jan 23

jyknight added a comment to D73253: [llvm] Fix file ignoring inside directories.

I think we should instead remove the entire "tracked independently" parts, because that's no longer the recommended directory layout. And also remove these "global" ignores which you moved, because they're already in /.gitignore, and thus don't need to be in /llvm/.gitignore

Thu, Jan 23, 12:06 PM · Restricted Project
jyknight added a comment to D69868: Allow "callbr" to return non-void values.

The idea of moving the copies to a new MachineBasicBlock seems a reasonable solution. That said, it does mean there will be allocatable physical registers which are live-in to the following block, which is generally not allowed. As far as I can tell, I _think_ that should be fine in this particular circumstance, but I'm a little uneasy that I might be missing some reason why it'll be incorrect.

Thu, Jan 23, 11:07 AM · Restricted Project, Restricted Project

Jan 15 2020

jyknight added a comment to D67847: [Support] make report_fatal_error `abort` instead of `exit`.
In D67847#1693694, @rnk wrote:

The abort() function raises SIGABRT, for which the default behavior is to trigger a coredump. Do we actually want that behavior?

Either _exit() (long available extension, which lld already uses) or quick_exit() (the new C standard way) seem possibly preferable?

It's easy to crash LLVM even without this change, so anyone running LLVM better have core dumps configured the way they like. Failed asserts raise SIGABRT already, for example, and we have tons of those. The only difference is that now end users, who may have never configured this stuff, may see more crashes. If it's a problem, I'd consider it QoI: we should fix the report_fatal_error to use proper diagnostics anyway so end users don't see them as often, just as we would treat any other user-visible crash.

Jan 15 2020, 12:32 PM · Restricted Project, Restricted Project
Herald added a project to D55057: [Headers] Make max_align_t match GCC's implementation.: Restricted Project.
Jan 15 2020, 7:28 AM · Restricted Project

Jan 14 2020

jyknight added a comment to D71848: Allow the discovery of Android NDK's triple-prefixed binaries..

Since this change is not android-only, please update change description, and update some non-android tests.

Jan 14 2020, 3:34 PM · Restricted Project

Jan 10 2020

jyknight added inline comments to D69868: Allow "callbr" to return non-void values.
Jan 10 2020, 3:39 PM · Restricted Project, Restricted Project
jyknight added inline comments to D69868: Allow "callbr" to return non-void values.
Jan 10 2020, 12:15 PM · Restricted Project, Restricted Project
jyknight added a comment to D64830: [Xtensa 4/10] Add basic *td files with Xtensa architecture description..

@andreisfr @jyknight @ivanbaev Ping? Are there any news concerning these pull requests?

Jan 10 2020, 9:53 AM · Restricted Project

Jan 9 2020

jyknight reopened D69876: Allow output constraints on "asm goto".

Reopening, since this didn't actually land yet. BTW, this review still has the wrong contents in the latest uploaded-diff (showing llvm changes, not clang changes).

Jan 9 2020, 11:48 AM · Restricted Project, Restricted Project
jyknight added inline comments to D69876: Allow output constraints on "asm goto".
Jan 9 2020, 11:48 AM · Restricted Project, Restricted Project
jyknight accepted D72001: CodeGen: Use LLT instead of EVT in getRegisterByName.
Jan 9 2020, 9:45 AM · Restricted Project
jyknight added a comment to D72457: GlobalISel: Move getLLTForMVT/getMVTForLLT.

Can you add a comment noting the deficiencies of these conversions?

Jan 9 2020, 9:45 AM · Restricted Project

Jan 7 2020

jyknight added a comment to D69876: Allow output constraints on "asm goto".

I think you pushed the incorrect change? This was the clang half, but now it's showing the LLVM half. Can you re-upload the diff for the clang half?

Jan 7 2020, 2:45 PM · Restricted Project, Restricted Project
jyknight added inline comments to D71848: Allow the discovery of Android NDK's triple-prefixed binaries..
Jan 7 2020, 2:38 PM · Restricted Project

Jan 6 2020

jyknight added inline comments to D72001: CodeGen: Use LLT instead of EVT in getRegisterByName.
Jan 6 2020, 1:39 PM · Restricted Project
jyknight added a comment to D72197: [MC][ELF] Emit a relocation if target is defined in the same section and is non-local.

I think the question I have: What is the value (I don't mean to assume there is no value, but I want to understand the specific use case) of supporting this if the full generality of symbol interposition is not supported? (is there a well defined use case that is usable with this patch and doesn't need the full generality? Or is the use case going to be subtly broken if it changes even slighlty and happens to trip over another part of LLVM that doesn't support symbol interposition? (in which case this is a great patch, but only as part of an effort to fully support the general case))

Jan 6 2020, 11:45 AM · Restricted Project
jyknight accepted D69876: Allow output constraints on "asm goto".

LGTM modulo some minor wording.

Jan 6 2020, 9:56 AM · Restricted Project, Restricted Project
jyknight added inline comments to D72001: CodeGen: Use LLT instead of EVT in getRegisterByName.
Jan 6 2020, 9:47 AM · Restricted Project
jyknight added a comment to D72197: [MC][ELF] Emit a relocation if target is defined in the same section and is non-local.

I don't see the behavior you say gnu as has.

Jan 6 2020, 8:31 AM · Restricted Project
jyknight added a comment to D72197: [MC][ELF] Emit a relocation if target is defined in the same section and is non-local.

I don't see the behavior you say gnu as has.

Jan 6 2020, 7:01 AM · Restricted Project

Jan 2 2020

jyknight created D72111: Move inline-asm setup/cleanup directives outside of the "#APP" "#NO_APP" comment..
Jan 2 2020, 2:09 PM · Restricted Project
jyknight committed rGb747607bec4f: update_test_checks: match CHECK-EMPTY lines for replacement. (authored by jyknight).
update_test_checks: match CHECK-EMPTY lines for replacement.
Jan 2 2020, 9:21 AM

Dec 19 2019

jyknight added a comment to D71037: [Diagnostic] Add ftabstop to -Wmisleading-indentation.

BTW, the commit here should mark llvm.org/PR44324 as fixed by it.

Dec 19 2019, 7:23 AM · Restricted Project
jyknight added a comment to D71037: [Diagnostic] Add ftabstop to -Wmisleading-indentation.

after fixing the bug rsmith spotted. there is no test failures in clang + clang-tool + clangd with UseTabStopOption = true (i found this quite surprising but i double checked). the previous test result were incorrect due to this bug sorry. however I am still not sure that UseTabStopOption = true is the right default for every uses of getSpellingColumnNumber.

Dec 19 2019, 7:13 AM · Restricted Project

Dec 17 2019

jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

.push_align_branch_boundary [N,] [instruction,]*

I'd like to raise again the possibility of using a more general region directive to denote "It is allowable to add prefixes/nops before instructions in this region if the assembler wants to", as I'd started discussing in https://reviews.llvm.org/D71238#1786885 (but let's move the discussion here).

James, I think this proposal is increasing the scope of this proposal too much. It also ignores some of the use cases identified and described in the writeup (i.e. the scoped semantics). I'm open to discussing such a feature more generally, but I'd prefer to see a more narrowly focused feature immediately.

Dec 17 2019, 1:08 PM · Restricted Project, Restricted Project
jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

I'd like to raise again the possibility of using a more general region directive to denote "It is allowable to add prefixes/nops before instructions in this region if the assembler wants to", as I'd started discussing in https://reviews.llvm.org/D71238#1786885 (but let's move the discussion here).

Dec 17 2019, 8:43 AM · Restricted Project, Restricted Project

Dec 16 2019

jyknight added a comment to D71238: Align non-fused branches within 32-Byte boundary (basic case).

I do like the idea of generalizing bundle_lock to mean generally "keep these instructions together and don't introduce anything extraneous in the middle". So, ".boundary_align <argument>" would apply to the next instruction-or-instruction-bundle, and will emit nops at its location, such that the next instruction is guaranteed to have the proper "within but not ending at a given 2**<arg> block" alignment.

Dec 16 2019, 3:47 PM · Restricted Project
jyknight added a comment to D71046: Support Intel "l" suffixes for x86_64 R8-R15 registers..

Yes, I had expressed a dislike to adding these alises, as there's no pressing need to do so.

Dec 16 2019, 12:43 PM · Restricted Project

Dec 10 2019

jyknight added a comment to D71238: Align non-fused branches within 32-Byte boundary (basic case).

Honestly, I both strongly agree with this, and see the argument as a somewhat lost cause. I think in practical terms, we *will* have to support something which works for both compiler generated assembly and legacy hand written assembly. I dislike that fact and the design it encourages, but it's reality.

Dec 10 2019, 10:37 AM · Restricted Project

Dec 9 2019

jyknight added a comment to D71238: Align non-fused branches within 32-Byte boundary (basic case).

In function X86AsmBackend::alignBranchesBegin, I added the comment

// The prefix or nop isn't inserted if the previous item is hard code, which
// may be used to hardcode an instruction, since there is no clear instruction
// boundary.

I'm sorry if I didn't make it clear. As far as i am concerned, I think the hard code case should be dealt with.

I'm still not following. Can you explain the use case here? What test case differs based on the presence of the "hard code" support in the original patch?

Dec 9 2019, 8:03 PM · Restricted Project
jyknight accepted D71106: [MC] Delete MCCodePadder.
Dec 9 2019, 6:50 AM · Restricted Project

Dec 5 2019

jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

I've been digging through the code for this for the last day or so. This is a new area for me, so it's possible I'm off base, but I have some concerns about the current design.

First, there appears to already be support for instruction bundling and alignment in the assembler today. I stumbled across the .bundle_align_mode, .bundle_start, and .bundle_end mechanism (https://lists.llvm.org/pipermail/llvm-dev/2012-December/056723.html) which seems to *heavily* overlap with this proposal. I suspect that the compiler support suggested by James and myself earlier in this thread could be implemented on to this existing mechanism.

Second, the new callbacks and infrastructure added appear to overlap heavily w/the MCCodePadding infrastructure. (Which, admitted, appears unused and untested.)

Dec 5 2019, 3:31 PM · Restricted Project, Restricted Project

Dec 4 2019

jyknight committed rG90fce46fa6c9: Fix crash-on-invalid-code in lambda constant evaluation. (authored by jyknight).
Fix crash-on-invalid-code in lambda constant evaluation.
Dec 4 2019, 12:16 PM

Nov 26 2019

jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

I have some other concerns about the code itself, but after pondering this a little bit, I'd like to instead bring up some rather more general concerns about the overall approach used here -- with some suggestions. (As these comments are not really comments on the _code_, but on the overall strategy, they also apply to the gnu binutils patch for this same feature.)

Nov 26 2019, 8:07 AM · Restricted Project, Restricted Project

Nov 21 2019

jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

Thanks for the comments, they help a little. But it's still somewhat confusing, so let me write down what seems to be happening:

Nov 21 2019, 3:15 PM · Restricted Project, Restricted Project
jyknight added a comment to D70508: Fix an offset underflow bug in DwarfExpression when describing small values with subregisters.

The test dwarf-size-field-overflow.test now takes over 60 seconds to run, which seems quite excessive.

Is there no way to test this in a less-expensive manner?

I almost halved the number of iterations in 1b9ef. On my iMac Pro in Release+Asserts it's running in 1.18s wall clock time now. Note however that even before my change it was only taking ~5s. Were you measuring a debug build?

Nov 21 2019, 10:05 AM · Restricted Project, debug-info
jyknight committed rGd3fec7fb4561: LLD: Don't use the stderrOS stream in link before it's reassigned. (authored by jyknight).
LLD: Don't use the stderrOS stream in link before it's reassigned.
Nov 21 2019, 7:58 AM
jyknight closed D70492: LLD: Assign the stderrOS and stdoutOS globals to the new argument values, before using via enableColors..
Nov 21 2019, 7:58 AM · Restricted Project

Nov 20 2019

jyknight added a comment to D70508: Fix an offset underflow bug in DwarfExpression when describing small values with subregisters.

The test dwarf-size-field-overflow.test now takes over 60 seconds to run, which seems quite excessive.

Nov 20 2019, 7:56 PM · Restricted Project, debug-info
jyknight committed rGe47d6da8a5dd: D'oh. Fix assert after a84922916e6eddf701b39fbd7fe0222cb0fee1d6. (Which was… (authored by jyknight).
D'oh. Fix assert after a84922916e6eddf701b39fbd7fe0222cb0fee1d6. (Which was…
Nov 20 2019, 7:29 PM
jyknight committed rGa84922916e6e: Fix unused variable warning in NDEBUG mode after… (authored by jyknight).
Fix unused variable warning in NDEBUG mode after…
Nov 20 2019, 7:11 PM
jyknight committed rGe74b326b1f50: Rename 'DenormalMode' in CommandFlags.inc to 'DenormalFPMath', as its option is… (authored by jyknight).
Rename 'DenormalMode' in CommandFlags.inc to 'DenormalFPMath', as its option is…
Nov 20 2019, 9:17 AM
jyknight created D70492: LLD: Assign the stderrOS and stdoutOS globals to the new argument values, before using via enableColors..
Nov 20 2019, 7:18 AM · Restricted Project

Nov 16 2019

jyknight committed rGbf142fc43347: MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0. (authored by jyknight).
MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0.
Nov 16 2019, 6:53 AM
jyknight closed D70062: MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0..
Nov 16 2019, 6:53 AM · Restricted Project

Nov 15 2019

jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

Overall comment: this whole change needs more comments, everywhere. Both for the added functions, and for the test cases. There is almost no description of what's happening, and it could really use it.

Nov 15 2019, 1:30 PM · Restricted Project, Restricted Project
jyknight added a comment to D70157: Align branches within 32-Byte boundary(NOP padding).

Even though core2 isn't affected by the erratum, core2 code can run on CPUs that do have the bug (and core2 is a popular target for code that needs to run "everywhere"), therefore all target CPUs that predate a hardware fix really

So perf of all code/generic codegen will go down. This is not very acceptable. -1 for making this enabled by default for generic codegen.

I'm okay with this not being the default if we document somewhere that LLVM assumes that machines have up to date microcode installed.

Nov 15 2019, 7:24 AM · Restricted Project, Restricted Project

Nov 12 2019

jyknight added a reviewer for D69411: [MC] Parse .if conditions with symbols in consecutive MCDataFragements: jyknight.
Nov 12 2019, 1:43 PM · Restricted Project
jyknight added a comment to D69411: [MC] Parse .if conditions with symbols in consecutive MCDataFragements.

Making this work only on ".if" is IMO a non-starter, at least without understanding why. So I looked into what broke with llvm/test/MC/MachO/reloc-diff.s.

Nov 12 2019, 1:43 PM · Restricted Project

Nov 11 2019

jyknight accepted D69352: [Sparc] Fix "Cannot select" error for AtomicFence on 32-bit V9.
Nov 11 2019, 11:54 AM · Restricted Project
jyknight added inline comments to D70062: MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0..
Nov 11 2019, 11:53 AM · Restricted Project
jyknight updated the diff for D70062: MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0..

Update for comment.

Nov 11 2019, 10:49 AM · Restricted Project
jyknight added inline comments to D70062: MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0..
Nov 11 2019, 10:49 AM · Restricted Project
jyknight added a comment to D67573: Fix __atomic_is_lock_free's return type..

Ping!

Nov 11 2019, 8:13 AM · Restricted Project

Nov 10 2019

jyknight added a comment to D69876: Allow output constraints on "asm goto".

Also, since this means we are no longer simply implementing according to GCC's documentation, I think this means we'll need a brand new section in the Clang docs for its inline-asm support.

Nov 10 2019, 8:23 PM · Restricted Project, Restricted Project
jyknight added a comment to D69876: Allow output constraints on "asm goto".

I think -Wuninitialized (UninitializedValues.cpp) should be taught how to detect the use of output variables in error blocks, at least for trivial cases.

Nov 10 2019, 7:56 PM · Restricted Project, Restricted Project
jyknight created D70062: MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0..
Nov 10 2019, 1:35 PM · Restricted Project

Nov 7 2019

jyknight added a comment to D69751: [AsmWritter] Fixed "null check after dereferencing" warning.
It should never be required in normal circumstances, but this function can also be used while debugging, where that would be convenient.

Not sure how it can be used currently, maybe with a big luck, since there is null pointer dereferencing.

I am gonna commit this.

Nov 7 2019, 10:47 AM · Restricted Project
jyknight added a comment to D64830: [Xtensa 4/10] Add basic *td files with Xtensa architecture description..

@jyknight , as I'm understood, Cadence doesn;t want to publish Xtensa ISA. But it seems that documentation from the link that you provided is quite actual, probably it was published when Xtensa was owned by Tensilica. Also, the code can be reviewed by people from companies that use Xtensa IP in their chips.

Nov 7 2019, 8:46 AM · Restricted Project

Nov 6 2019

jyknight added a comment to D69751: [AsmWritter] Fixed "null check after dereferencing" warning.

Oops, it was my fault that I put an access before the check.

Nov 6 2019, 7:04 AM · Restricted Project

Nov 5 2019

jyknight added a comment to D64830: [Xtensa 4/10] Add basic *td files with Xtensa architecture description..

@andreisfr : Ping?

Nov 5 2019, 2:56 PM · Restricted Project

Nov 4 2019

jyknight added a comment to D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..

Updated release notes in d11a9018b773c0359934a7989d886b02468112e4.

Nov 4 2019, 1:31 PM · Restricted Project
jyknight committed rGd11a9018b773: Add release notes for commit ccc4d83cda16bea1d9dfd0967dc7d2cfb24b8e75. (authored by jyknight).
Add release notes for commit ccc4d83cda16bea1d9dfd0967dc7d2cfb24b8e75.
Nov 4 2019, 1:30 PM
jyknight added a comment to D69756: [opaque pointer types] Add element type argument to IRBuilder CreatePreserveStructAccessIndex and CreatePreserveArrayAccessIndex.

Updated release notes in d11a9018b773c0359934a7989d886b02468112e4.

Nov 4 2019, 1:29 PM · Restricted Project, Restricted Project

Oct 28 2019

jyknight added a comment to D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..

We could probably do a quick check to see if the class informally conforms to the protocol. +copyWithZone seems to be marked unavailable in ARC; not sure if that would cause problems for such a check.

Oct 28 2019, 12:46 PM · Restricted Project
jyknight added a comment to D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..

After this, Class can no longer be used as a key type in an Obj-C dictionary literal. Is that intentional?

Oct 28 2019, 8:22 AM · Restricted Project

Oct 22 2019

jyknight added a comment to D64830: [Xtensa 4/10] Add basic *td files with Xtensa architecture description..

I do not think there is a reason why the Xtensa architecture shouldn't be included in LLVM. As a comparison, there is also the proprietary (Google) Lanai architecture which was added at a time when there was little public information on it and to this time nobody can actually buy Lanai hardware (there is only a simulator). As a comparison, Xtensa has easy to get hardware (in the form of the ESP8266/ESP32) and is already supported in GCC/binutils.

Oct 22 2019, 6:26 PM · Restricted Project

Oct 17 2019

jyknight committed rGccc4d83cda16: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer… (authored by jyknight).
[ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer…
Oct 17 2019, 8:27 AM
jyknight closed D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..
Oct 17 2019, 8:27 AM · Restricted Project
jyknight committed rL375125: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object.
[ObjC] Diagnose implicit type coercion from ObjC 'Class' to object
Oct 17 2019, 8:27 AM
jyknight committed rG1c982af05997: [ObjC] Add some additional test cases around pointer conversions. (authored by jyknight).
[ObjC] Add some additional test cases around pointer conversions.
Oct 17 2019, 8:18 AM
jyknight closed D67982: [ObjC] Add some additional test cases around pointer conversions..
Oct 17 2019, 8:18 AM · Restricted Project
jyknight committed rL375124: [ObjC] Add some additional test cases around pointer conversions..
[ObjC] Add some additional test cases around pointer conversions.
Oct 17 2019, 8:17 AM

Oct 16 2019

jyknight added a comment to D68964: cmake/modules/CheckAtomic.cmake: catch false positives in RISC-V.

This is bogus -- the RISCV GCC implementation is broken. It should not be mixing libatomic function calls with direct atomics.

Oct 16 2019, 7:40 AM · Restricted Project

Oct 7 2019

jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

The commit was done in a hurry. For the initial commit of a brand new project that sets up the project hierarchy, this seems to have received fewer than enough thumbs up. Many points raised in the review process were just shrugged off.

I don't know if it matters anymore because this was committed but I agree with @MaskRay. His suggestion of using llvm-objcopy to rename the symbols for tests makes much more sense to me. I haven't seen a libc that does testing in an ergonomic way and this suggestion seems the best to me, frankly.

There is a lot going on here, it's hard to follow it all in one patch, and I think some comments got lost because of this. I feel like a lot of big design decisions were made here, did I miss something on the libc-dev mailing list?

Oct 7 2019, 3:06 PM · Restricted Project, Restricted Project
jyknight reopened D28213: [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match builtin.

The close was due to phabricator problem, reopening.

Oct 7 2019, 7:37 AM · Restricted Project, Restricted Project

Oct 3 2019

jyknight added inline comments to D68410: [AttrDocs] document always_inline.
Oct 3 2019, 11:41 AM · Restricted Project

Oct 2 2019

jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

The issue really only exists when you refer to object files across standards layers -- e.g., using an object file that exposes the POSIX symbol "open" from an object file implementing ISO C. If you make sure to always strictly-layer the libc, so that ISO C-implementing object files don't use any POSIX-exporting object files, and so on, you won't need to mark anything weak. For the example of "open", you'd have an internal implementation of open in its own file, only exposing libc-internal symbols. Then fopen (ISO C) can use that safely, without dragging in a definition of the symbol open. Separately, the implementation of open (POSIX) can be defined in its own file, also based on the internal open.)

This approach is fairly general can be adopted with the existing setup as well. In fact, I can image that irrespective of the approach we take, we will end up with patterns like this.

Oct 2 2019, 2:50 PM · Restricted Project, Restricted Project
jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

The objcopy step is required to avoid putting mangled names with the alias attribute. If there is any other way to achieve the same thing, I am open to it.

Ah, I see! I'd suggest using extern "C" instead. There's no need for these be C++-mangled -- you can simply use a name prefix instead. E.g., if you define it as extern "C" __llvm_libc_strcpy(...) {} then it's trivial to make the strcpy alias without objcopy magic.

Yes, this solution was considered. But, it does not really solve the problem you brought up; we will still need to make the alias weak.

Oct 2 2019, 1:27 PM · Restricted Project, Restricted Project
jyknight added a comment to D67847: [Support] make report_fatal_error `abort` instead of `exit`.

The abort() function raises SIGABRT, for which the default behavior is to trigger a coredump. Do we actually want that behavior?

Oct 2 2019, 12:32 PM · Restricted Project, Restricted Project

Sep 30 2019

jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

The objcopy step is required to avoid putting mangled names with the alias attribute. If there is any other way to achieve the same thing, I am open to it.

Sep 30 2019, 2:35 PM · Restricted Project, Restricted Project
jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

Maybe everything is fine, but given this setup, does anyone see any potential problems with compiling these functions for nvptx? I'd like to eventually see a mode where we compile an appropriate subset of these functions for GPU targets -- either in bitcode form for linking with our device-side OpenMP runtime library or as a native object -- to provide a more feature-complete offloading environment.

The one thing that caught by eye was the use of the section attribute, and I was curious what nvptx does with that. As far as I can tell, perhaps the answer is nothing.

Then I think this scheme won't work, since the point of the sections is to enable the creation of the global symbols post-build.

E.g., I think the idea is that the main implementation defines the function with C++ name __llvm_libc::strcpy(char *, const char *), and places the code in the .llvm.libc.entrypoint.strcpy section. And then another tool comes along and iterates the llvm.libc.entrypoint sections, and adds global symbol aliases for each one.

That scheme feels probably over-complex, IMO, but I don't have an concrete counter-proposal in mind.

For what it's worth, FreeBSD libc does a similar namespacing trick in C. The internal symbols are underscore prefixed and they're exported as aliases (typically as weak aliases, to allow them to be preempted by other implementations, and to explicitly give names to callers for the preemptible and non-preemptible versions). Making symbols preemptible isn't really possible with PE/COFF, because the linkage model has a stronger concept of where definitions come from than ELF (at least, in the absence of symbol versions in ELF). On ELF platforms, we should support symbol versions as early as possible, because adding them later is an ABI break, even if we change no code.

Sep 30 2019, 9:11 AM · Restricted Project, Restricted Project

Sep 27 2019

jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

Maybe everything is fine, but given this setup, does anyone see any potential problems with compiling these functions for nvptx? I'd like to eventually see a mode where we compile an appropriate subset of these functions for GPU targets -- either in bitcode form for linking with our device-side OpenMP runtime library or as a native object -- to provide a more feature-complete offloading environment.

The one thing that caught by eye was the use of the section attribute, and I was curious what nvptx does with that. As far as I can tell, perhaps the answer is nothing.

Sep 27 2019, 9:42 AM · Restricted Project, Restricted Project
jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

I did consider such a layout. However, the same kind of distinction can be achieved by two things:

  1. Next to the implementation and/or target listing for a function, call out the standard/extension that prescribes it.
  2. When composing the target for libc.a for a platform, group the functions per standards/extensions they come from.

    Another point which made me not pick this layout: I agree that as a catalog, the structure you are suggesting could be more meaningful. But as a developer, my mental model is much simpler if all the functions from a header file are grouped in one place, irrespective of the standard they come from.
Sep 27 2019, 7:00 AM · Restricted Project, Restricted Project

Sep 25 2019

jyknight added a comment to D67867: [libc] Add few docs and implementation of strcpy and strcat..

Some high level comments on your filesystem layout standard:

Sep 25 2019, 10:10 AM · Restricted Project, Restricted Project

Sep 24 2019

jyknight added a comment to D67573: Fix __atomic_is_lock_free's return type..

Ping.

Sep 24 2019, 2:17 PM · Restricted Project
jyknight added a comment to D67982: [ObjC] Add some additional test cases around pointer conversions..

(See https://reviews.llvm.org/D67983 for the proposed behavior change.)

Sep 24 2019, 2:00 PM · Restricted Project
jyknight added a comment to D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..

Note that the test-case diffs are on top of https://reviews.llvm.org/D67982, which I split out to make the actual change in behavior in this commit clearer.

Sep 24 2019, 2:00 PM · Restricted Project
jyknight created D67983: [ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types..
Sep 24 2019, 1:59 PM · Restricted Project
jyknight created D67982: [ObjC] Add some additional test cases around pointer conversions..
Sep 24 2019, 1:58 PM · Restricted Project

Sep 23 2019

jyknight added inline comments to D67867: [libc] Add few docs and implementation of strcpy and strcat..
Sep 23 2019, 5:53 PM · Restricted Project, Restricted Project

Sep 21 2019

jyknight committed rGc2ca003baffb: NFC: Change ObjCQualified*TypesAreCompatible to take ObjCObjectPointerType… (authored by jyknight).
NFC: Change ObjCQualified*TypesAreCompatible to take ObjCObjectPointerType…
Sep 21 2019, 3:34 PM
jyknight committed rL372492: NFC: Change ObjCQualified*TypesAreCompatible to take.
NFC: Change ObjCQualified*TypesAreCompatible to take
Sep 21 2019, 3:34 PM

Sep 20 2019

jyknight added a comment to D67802: [SelectionDAG][Mips][Sparc] Don't allow SimplifyDemandedBits to constant fold TargetConstant nodes to a Constant..

Sparc change looks good.
Don't know about the MIPS one -- seems like probably something upstream should be creating a Constant instead of a TargetConstant, rather than converting it there?

Sep 20 2019, 7:23 AM · Restricted Project

Sep 17 2019

jyknight committed rL372184: Request commit access for jyknight.
Request commit access for jyknight
Sep 17 2019, 2:12 PM

Sep 16 2019

jyknight added a comment to D67601: TLI: Remove DAG argument from getRegisterByName.

The code is attempting to ensure that you don't use RBP as a global register unless RBP is actually a reserved register (being used as the frame pointer in the function.) That's a reasonable goal, but maybe there's another better way to be doing it.

Sep 16 2019, 7:37 AM