joerg (Joerg Sonnenberger)
User

Projects

User Details

User Since
Nov 23 2012, 10:16 AM (239 w, 2 d)

Recent Activity

Thu, Jun 22

joerg added a comment to D33895: [Support] Add TempFailureRetry helper function.

Do you need someone to commit this?

Thu, Jun 22, 8:14 AM
joerg added a comment to D34506: Relax an assert in the comparison of source locations.

I don't think it is a good idea to make this function non-transitive.

Thu, Jun 22, 7:27 AM
joerg added a comment to D34387: [PATCH 2/2] Implement "probe-stack" on x86.

It would be nice to make the stackprobesize a proper TLI attribute, so that OSes can decide how much guarding they are willing to guarantee. I think I would also like to have an option to inline the probing without the complexity of the function call. But both can be done as a separate step.

Thu, Jun 22, 7:05 AM
joerg accepted D34136: [Solaris] replace Solaris.h hack with a set of better hacks.
Thu, Jun 22, 4:47 AM

Wed, Jun 21

joerg added a comment to D34409: Use 64bit jump table with large code model on 64bit.

If the jump table is writable

FWIW, that also sounds like a hack and a (minor?) security issue.

Wed, Jun 21, 7:20 AM
joerg added a comment to D34409: Use 64bit jump table with large code model on 64bit.

If the jump table is writable, you can just use the absolute pointers, PIC or no PIC. That would be the "block address" encoding.

Wed, Jun 21, 2:16 AM
joerg added a comment to D34397: [SCEV] Make MulOpsInlineThreshold lower to avoid excessive compilation time.

What about the old TODO item of extending powi to integer types and folding them together in the middle end?

Joerg, what TODO item do you mean? Where can I read about it?
Anyways, even if we have a concept of powi in IR, it does not automatically mean that we have it in SCEV. It would be extremely good to have it, though, but it looks like a massive task that takes time.

Wed, Jun 21, 2:14 AM

Tue, Jun 20

joerg added a comment to D34409: Use 64bit jump table with large code model on 64bit.

If you want to create a stop-gap solution that bad, I would make it emit the jump table as writable for non-PIC && largeish code model. That's a much more contained change. It would be really better to work on the real fix and not add more hacks...

Tue, Jun 20, 4:15 PM
joerg added a comment to D34409: Use 64bit jump table with large code model on 64bit.

For some reason we are using large code model with PIC in the JIT and this is the only issue I see on x86-64 so far.

Tue, Jun 20, 4:12 PM
joerg accepted D33895: [Support] Add TempFailureRetry helper function.

Go ahead.

Tue, Jun 20, 3:05 PM
joerg added a comment to D34409: Use 64bit jump table with large code model on 64bit.

The x86_64 code is mixed: it is correct for non-PIC but large, it doesn't work correctly for PIC. That covers the cases most people have been interested in, especially since large model and PIC runs into various other issues too from what I remember.

Tue, Jun 20, 3:03 PM
joerg added a comment to D34409: Use 64bit jump table with large code model on 64bit.

The entirely sensible assumption of the PPC backend is that a single function is no longer than 2GB/4GB.

What's being produced is an offset from the basic blocks (.text) to the Jump table (.rodata). That's not necessarily 32-bits, and I think there are entirely legitimate reasons for putting jump tables in .rodata.

Tue, Jun 20, 2:08 PM
joerg requested changes to D34409: Use 64bit jump table with large code model on 64bit.

At least the PPC change is definitely wrong. AArch64 should be wrong as well from what I discussed with Tim.

Tue, Jun 20, 1:42 PM
joerg added a comment to D34397: [SCEV] Make MulOpsInlineThreshold lower to avoid excessive compilation time.

What about the old TODO item of extending powi to integer types and folding them together in the middle end?

Tue, Jun 20, 5:51 AM

Mon, Jun 19

joerg added a comment to D34322: [lldb] Correctly escape newlines and backslashes in the JSON serializer.

Not parsers, encoders. Note that the escaping is not correct for control characters other than \n.

Mon, Jun 19, 10:04 AM · Restricted Project
joerg added a comment to D34322: [lldb] Correctly escape newlines and backslashes in the JSON serializer.

I don't disagree with you, but please see the referenced review for further details.

Mon, Jun 19, 9:30 AM · Restricted Project

Sun, Jun 18

joerg added a comment to D34322: [lldb] Correctly escape newlines and backslashes in the JSON serializer.

My suggestion would be to just use the YAML writer for now and leave a comment to make it clear that this is really JSON only.

Sun, Jun 18, 3:01 PM · Restricted Project
joerg accepted D33874: Implement AllocateRWX and ReleaseRWX for NetBSD.
Sun, Jun 18, 9:49 AM

Sat, Jun 17

joerg added a comment to D34322: [lldb] Correctly escape newlines and backslashes in the JSON serializer.

Please see the discussion in D31992. This patch seems to go in the wrong direction.

Sat, Jun 17, 5:56 PM · Restricted Project
joerg added a comment to D34018: Support __float128 on NetBSD libstdc++ x86/x86_64.

As I said, I don't see the point in pretending we support float128 when the runtime doesn't contain the necessary pieces.

Sat, Jun 17, 11:36 AM

Wed, Jun 14

joerg added inline comments to D33895: [Support] Add TempFailureRetry helper function.
Wed, Jun 14, 6:19 AM
joerg added inline comments to D34136: [Solaris] replace Solaris.h hack with a set of better hacks.
Wed, Jun 14, 1:52 AM

Tue, Jun 13

joerg added inline comments to D34136: [Solaris] replace Solaris.h hack with a set of better hacks.
Tue, Jun 13, 11:04 AM
joerg added inline comments to D34136: [Solaris] replace Solaris.h hack with a set of better hacks.
Tue, Jun 13, 5:56 AM

Sun, Jun 11

joerg added a comment to D34088: [DAGCombine] Make sure we check the ResNo from UADDO before combining.

This fixes the problem in mbedtls, thanks.

Sun, Jun 11, 4:28 AM

Thu, Jun 8

joerg added a comment to D34018: Support __float128 on NetBSD libstdc++ x86/x86_64.

Soft-float on the runtime environment part. I.e. non-trivial operations are lowered to library calls.

Thu, Jun 8, 5:54 AM
joerg added a comment to D34018: Support __float128 on NetBSD libstdc++ x86/x86_64.

At the very least, missing test case.

Thu, Jun 8, 4:55 AM

Wed, Jun 7

joerg added a comment to D33726: [driver][netbsd] Build and pass `-L` arguments to the linker.
In D33726#774105, @ruiu wrote:

I'm totally against adding per-OS path knowledge to our linker. Compilers already know include paths and I don't want to maintain another list of paths in the linker. Also this can be more confusing than useful when you are doing cross-linking.

Wed, Jun 7, 6:55 AM
joerg added a comment to D31972: Do not force the frame pointer by default for ARM EABI.

Actually, for NetBSD we want to use -fomit-frame-pointer by default whenever the implicit -funwind-tables is also present. In general, that should be the justification for the default behavior: "Can I reliably unwind a binary with the available information?" Performance of stack unwinding is IMO secondary and users of sanitizers can disable it where necessary.

Wed, Jun 7, 6:28 AM
joerg added a comment to D33874: Implement AllocateRWX and ReleaseRWX for NetBSD.

Given that W^X is becoming a lot more popular across systems including SELinux and other variants, I think it would be better to extend MemoryBlock to store separate pointers for W and X mappings. That avoids the complexity of storing the pointer directly in the allocation.

I was thinking about this and I was evaluating this option. My concern whether it is appropriate to include additional internal pointer for all targets unconditionally or just one extra for NetBSD (and other who can catch up).

I will add this pointer without ifdefs.

Wed, Jun 7, 5:46 AM

Tue, Jun 6

joerg added a comment to D33874: Implement AllocateRWX and ReleaseRWX for NetBSD.

Given that W^X is becoming a lot more popular across systems including SELinux and other variants, I think it would be better to extend MemoryBlock to store separate pointers for W and X mappings. That avoids the complexity of storing the pointer directly in the allocation.

Tue, Jun 6, 2:39 PM

Thu, Jun 1

joerg added a comment to D33726: [driver][netbsd] Build and pass `-L` arguments to the linker.

A small subset can be found by searching for LINKER_RPATH_FLAG in pkgsrc. A classic offender is Emacs. For more, I would have to systematically search.

Thu, Jun 1, 11:37 AM

Wed, May 31

joerg added a comment to D33726: [driver][netbsd] Build and pass `-L` arguments to the linker.

sysroot is already handled in NetBSD.cpp line 118 or so.

Wed, May 31, 3:39 PM
joerg added a comment to D33726: [driver][netbsd] Build and pass `-L` arguments to the linker.

Such knowledge is necessary anyway. There is enough software that wants to use the linker directly.

Wed, May 31, 3:38 PM
joerg added a comment to D33726: [driver][netbsd] Build and pass `-L` arguments to the linker.

I'm against it. I consider this a strong bug on the LLD side and the behavior of clang correct.

Wed, May 31, 3:12 PM

Mon, May 29

joerg committed rL304179: Revert r303763, results in asserts i.e. while building Ruby..
Revert r303763, results in asserts i.e. while building Ruby.
Mon, May 29, 3:52 PM

May 21 2017

joerg added a comment to D32782: Add pthread_self function prototype and make it speculatable..

Strictly speaking, the glibc attribute violates the specification of const. I.e. we could turn a call for pthread_self() into a once() initialised static variable and that transform would be valid under the const rules. That clearly doesn't reflect the intention...

May 21 2017, 4:29 AM

May 20 2017

joerg added a comment to D33372: Infer relocation model from module flags in relocatable LTO link.
In D33372#760060, @pcc wrote:

Non-LTO pipeline allows the user to put PIC code in a non-PIE executable, or non-PIC code in a shared library if they wish so. Maybe we should completely ignore the output type here and strictly go by module flags, to be consistent.

Disabling PIC can sometimes act as an optimization.

May 20 2017, 4:13 AM

May 19 2017

joerg added inline comments to D33356: [Nios2] Changes in frontend to support Nios2 LLVM target.
May 19 2017, 9:19 AM
joerg added inline comments to D33356: [Nios2] Changes in frontend to support Nios2 LLVM target.
May 19 2017, 7:50 AM
joerg added inline comments to D33356: [Nios2] Changes in frontend to support Nios2 LLVM target.
May 19 2017, 7:16 AM

May 18 2017

joerg added a comment to D33304: [clang-tidy][Part1] Add a new module Android and three new checks..

I find the use of "must" at the very least inappropriate. If there was no use case for not including it, it wouldn't be an option. There is also nothing really Android-specific here beside maybe the open64 mess.

May 18 2017, 9:42 AM · Restricted Project
joerg added a comment to D33272: Method loadFromCommandLine should be able to report errors.

Can this use ErrorOr?

May 18 2017, 9:38 AM

May 17 2017

joerg added a comment to D31516: Separate {Min,Max}AtomicLockFreeWidth from MaxAtomicInlineWidth.

Lock-free operations provide two major advantages. You don't need to worry about signal safety and they can be mixed with certain non-atomic operations without creating havoc. All I said is that the presence of a 32bit CAS is enough to ensure lock-free atomic operations for (appropriately aligned) 8bit and 16bit values can be implemented. That will not be worse than any locked atomic operation on any non-brain-dead platform. E.g. it might not be true on SPARC v7 and v8 or the VAX, but then they don't have a 32bit CAS. It doesn't mean that you have to implement 16bit atomics using a 32bit CAS. I would hope the webassembly backend exposes atomics as precise operations, but if it only provides a 32bit CAS, that's still good enough for the needs of any frontend language.

May 17 2017, 2:00 AM

May 16 2017

joerg added a comment to D33259: Don't defer to the GCC driver for linking arm-baremetal.

While I fully agree that the current fallback-to-GCC behavior is far from helpful, I'm not sure how much sense providing linker support for bare-metal makes. I would expect this to changes wildly depending on the specific environment.

May 16 2017, 3:57 PM
joerg added a comment to D31516: Separate {Min,Max}AtomicLockFreeWidth from MaxAtomicInlineWidth.

I don't get this. If you have a lock-free 32bit CAS, you can implement all the 16bit operations on top of that and they are still lock-free.

May 16 2017, 7:05 AM

May 15 2017

joerg added a comment to D32605: Recognize CTLZ builtin.

Can you check the countable part in one of the cases? Otherwise it looks good.

If I get yuo right, "ctlz_and_other" checks conversion to countable loop and that CPUs that not support ctlz will not insert it in this case.

May 15 2017, 12:59 PM
joerg added a comment to D32605: Recognize CTLZ builtin.

Can you check the countable part in one of the cases? Otherwise it looks good.

May 15 2017, 10:10 AM

May 10 2017

joerg added a comment to D33046: [ELF] - Set DF_TEXTREL flag properly..

At least NetBSD doesn't support/use DF_TEXTREL and only DT_TEXTREL.

May 10 2017, 1:28 PM
joerg added a comment to D33041: [ELF] - Set DF_STATIC_TLS flag for x86_64 target..

It's actually more a diagnostic hint. Due to things like Nvidia's binary-only libGL, this is actually supported by most TLS implementations as long as no initializers are needed.

May 10 2017, 1:26 PM
joerg accepted D33018: [compiler-rt][cmake] Provide empty version of enable_execute_stack for baremetal targets.
May 10 2017, 7:36 AM
joerg added a comment to D32605: Recognize CTLZ builtin.

Just as a side note: this is not only ARMv4. Older SPARC, M68K, SH, IA64, Alpha all seem to lack a FFS / CLZ instruction from cursory check.

May 10 2017, 5:01 AM

May 9 2017

joerg added a comment to D33018: [compiler-rt][cmake] Provide empty version of enable_execute_stack for baremetal targets.

To expand on what I said on IRC:

May 9 2017, 5:03 PM
joerg added a comment to D32605: Recognize CTLZ builtin.

If loop is just converted to countable other optimizations are applicable like unroll, LSR, vectorization... with potential great impact.

May 9 2017, 4:36 PM
joerg added a comment to D33018: [compiler-rt][cmake] Provide empty version of enable_execute_stack for baremetal targets.

Why do you call __enable_execute_stack in first place? I would just leave it and fix any potential callers.

May 9 2017, 4:06 PM
joerg added a comment to D32605: Recognize CTLZ builtin.
if the CPU has no direct lowering for the intrinsic, this transform is beneficial only if the resulting intrinsic can be constant folded

Why?
What about converting loop to countable?
What about clear range of CTLZ(X): 0 <= CTLZ(X) <= bitwidth(X)?

May 9 2017, 4:05 PM
joerg added a comment to D32605: Recognize CTLZ builtin.

Yeah, but even the generic expansion results in ~19 instructions on ARMv4. Compare that to one instruction in the loop and it can hardly be said to be a general win.

May 9 2017, 3:26 PM
joerg added a comment to D32605: Recognize CTLZ builtin.

That's not true. ARMv4 for example has no clz, it's a V5T feature. That's my point: if the CPU has no direct lowering for the intrinsic, this transform is beneficial only if the resulting intrinsic can be constant folded. But I wonder if we don't catch those cases already with SCEV based optimisations. If a CPU has no direct lowering like on ARMv4, it will add a libcall and with a high chance of being more expensive than the optimisation.

May 9 2017, 2:52 PM

May 5 2017

joerg committed rL302264: Add NetBSD to the list of platforms supporting death tests. Two unit.
Add NetBSD to the list of platforms supporting death tests. Two unit
May 5 2017, 11:10 AM
joerg committed rL302263: If posix_fallocate returns EOPNOTSUPP, fallback to ftruncate..
If posix_fallocate returns EOPNOTSUPP, fallback to ftruncate.
May 5 2017, 11:09 AM

Apr 27 2017

joerg added a comment to D32605: Recognize CTLZ builtin.

I agree. If the CPU has it, it will be beneficial. If it doesn't, it is only a useful transformation if the intrinsic can be constant folded.

Apr 27 2017, 2:08 PM
joerg added a comment to D32605: Recognize CTLZ builtin.

What about platforms that don't have ctlz/ffs hardware support?

Apr 27 2017, 11:53 AM
joerg added inline comments to D32149: Correct handling NetBSD core(5) files with threads.
Apr 27 2017, 7:02 AM · Restricted Project
joerg added a comment to D32564: AArch64: compress jump tables to minimum size needed to reach destinations.

My primary concern here is that it can make it impossible to hand-patch the resulting assembler. I'm not sure if anyone is doing that, but if I have learned one lesson from pkgsrc development and the set of Linux support patches, it is to expect "yes, someone is really doing" as most likely answer. As such, I would hope for some global option to disable the pass.

Apr 27 2017, 5:51 AM

Apr 25 2017

joerg added a comment to D32450: [libunwind] Add 64-bit SPARC support.

Liveness of registers is pretty much ephemeral at this point. The unwind register locations are not recursive either. They are applied in order.

Apr 25 2017, 1:52 PM

Apr 24 2017

joerg added inline comments to D32450: [libunwind] Add 64-bit SPARC support.
Apr 24 2017, 5:58 PM
joerg added a comment to D32450: [libunwind] Add 64-bit SPARC support.

You are missing the first loop in https://nxr.netbsd.org/xref/src/sys/lib/libunwind/DwarfParser.hpp#489

Apr 24 2017, 3:38 PM
joerg added a comment to D32427: Fix float abi for SUSE ARM triples.

I'm not sure the results will really work that well either.

Apr 24 2017, 6:06 AM

Apr 22 2017

joerg added a comment to D32120: Don't test setting sticky bits on files for (Free|Open)BSD.

I think a better idea would be to just allow this tests to fail with EPERM.

Apr 22 2017, 12:09 PM
joerg added a comment to D32141: docs: Explain how to generate a compilation database for Qt projects.

The change itself sounds fine, but the referenced documentation can likely be improved, i.e. searching for "qbs compilation database" or even "clangdb" doesn't trigger any hits here.

Apr 22 2017, 7:30 AM

Apr 20 2017

joerg added a comment to D6052: Avoid short relocation in x86_64 large code model.

My point remains.

Apr 20 2017, 3:43 PM

Apr 16 2017

joerg added a comment to D31992: [clangd] Escape only necessary characters in JSON output.

We already have a couple of case that expect the encoding to be compatible. I'm not very attached to the additional special cases from YAML, but having either a common escape function OR a JSON escape in LLVM/Support is quite important.

Apr 16 2017, 1:24 PM · Restricted Project
joerg added a comment to D31992: [clangd] Escape only necessary characters in JSON output.

Just to avoid any confusion: this should be the generic YAML escape routine in llvm/lib/Support, i.e. IMO we don't want to have separate YAML and JSON escape routines.
Effective, change YAMLParser.cpp line 697 to use \u and drop the whole UTF-8 handling part.

Apr 16 2017, 1:01 PM · Restricted Project
joerg added a comment to D31992: [clangd] Escape only necessary characters in JSON output.

The short version is perfectly fine as long as works for both JSON and YAML. Less output is always good :)

Apr 16 2017, 12:42 PM · Restricted Project

Apr 13 2017

joerg added a comment to D31992: [clangd] Escape only necessary characters in JSON output.

If I understand correctly, that's " and \ for JSON and ", \ and all non-printable characters (which unfortunately requires understanding of unicode to solve this fully correctly) in YAML.

Apr 13 2017, 12:16 PM · Restricted Project
joerg added a comment to D31992: [clangd] Escape only necessary characters in JSON output.

I'm strongly against this patch. Can you give an actual test case for the problematic behavior?

Apr 13 2017, 6:28 AM · Restricted Project

Apr 4 2017

joerg added a comment to D31573: [Builtins] Fix test cases for xf/ti.

Actually, there are three platforms that use: i386, amd64 and m68k. The latter might not currently be supported by LLVM, but it still exists.
__int64_t and therefore CRT_HAS_128BIT are supported by all 64bit platforms and only those. The two features are orthogonal.

Apr 4 2017, 4:32 AM

Apr 3 2017

joerg added a comment to D31573: [Builtins] Fix test cases for xf/ti.

Please do not drop checks for CRT_HAS_128BIT -- the code requirse__ int128_t and doesn't work on platforms without.

Apr 3 2017, 1:32 PM

Apr 2 2017

joerg added a comment to D31573: [Builtins] Fix test cases for xf/ti.

That would be perfectly reasonable. Some other places already tag it with HAS_80_BIT_LONG_DOUBLE, but I don't know what is responsible for setting that macro.

Apr 2 2017, 5:22 AM
joerg added a comment to D31573: [Builtins] Fix test cases for xf/ti.

This doesn't make sense to me. XF *is* for modes with Intel extended precision. IEEE 128bit floats should be TF.

Apr 2 2017, 1:21 AM

Mar 31 2017

joerg closed D31533: Do not translate rint into nearbyint, but truncate it like nearbyint.

r299247.

Mar 31 2017, 1:10 PM
joerg committed rL299247: Do not translate rint into nearbyint, but truncate it like nearbyint..
Do not translate rint into nearbyint, but truncate it like nearbyint.
Mar 31 2017, 1:10 PM
joerg created D31533: Do not translate rint into nearbyint, but truncate it like nearbyint.
Mar 31 2017, 6:52 AM

Mar 25 2017

joerg committed rL298799: Split the SimplifyCFG pass into two variants..
Split the SimplifyCFG pass into two variants.
Mar 25 2017, 11:56 PM
joerg closed D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase by committing rL298799: Split the SimplifyCFG pass into two variants..
Mar 25 2017, 11:56 PM
joerg accepted D31367: Expression: add missing linkage to RuntimeDyld component.
Mar 25 2017, 11:53 AM · Restricted Project
joerg accepted D31369: PluginUnwindAssemblyX86: add missing linkage to MCDisasm.
Mar 25 2017, 11:53 AM · Restricted Project

Mar 20 2017

joerg added inline comments to D23770: [AAP] (4) Add AAP basic tablegen (InstrInfo, RegInfo).
Mar 20 2017, 4:23 AM

Mar 19 2017

joerg added a comment to D30974: [CompilationDatabase] remove duplicate elements.

Personally, I think this should have been handled by whatever tool created the JSON database file in first place.

Mar 19 2017, 4:49 AM

Mar 18 2017

joerg added a comment to D31085: [InlineCost] Increase the cost of Switch.

Can you please also try this on top of the changes from D30333? That's changing one switch transformation to happen much later, making it more sensitive to inline cost estimates.

Mar 18 2017, 5:44 AM

Mar 13 2017

joerg added a comment to D30886: [ELF] Pad x86 executable sections with 0xcc int3 instructions.

Does this have any impact on compressibility of executables? E.g. gzip or xz.

Mar 13 2017, 6:06 AM
joerg added a comment to D30699: [ELF] - Stop producing broken output for R_386_GOT32X relocation..

Statically linked binaries don't normally have a GOT, but should synthesize an entry in .data for it. Chances are that is exactly the problem you are seeing?

Mar 13 2017, 4:34 AM

Mar 11 2017

joerg added a comment to D30733: [Driver] Add arch-specific rpath for libc++.

Installing libc++ along clang makes a lot of sense for non-system compilers. It doesn't imply any version locking like in GCC, i.e. you are still free to install whatever version of libunwind and libc++ you want. I'm somewhat conflicted about this patch. I think it is an actual improvement for some deployment cases, but I also consider it a bit of an abuse of the ressource directory. I'm not sure we have a better mechanism at hand right now though.

Mar 11 2017, 12:26 AM
joerg added a comment to D30699: [ELF] - Stop producing broken output for R_386_GOT32X relocation..

Are we talking about statically or dynamically linked programs? It makes a different for the former, but shouldn't for the latter.

Mar 11 2017, 12:06 AM

Mar 10 2017

joerg updated the diff for D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase.

Add comments on why the split pass is useful.

Mar 10 2017, 10:36 PM
joerg added inline comments to D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase.
Mar 10 2017, 10:34 PM

Mar 9 2017

joerg added inline comments to D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase.
Mar 9 2017, 11:01 PM
joerg updated the diff for D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase.

Move the full version out of the function simplification set into the late optimisation steps after all function inlining is done.

Mar 9 2017, 10:12 PM

Mar 5 2017

joerg added a comment to D30566: [ELF] - Do not try to create .eh_frame_hdr for relocatable output..

I'm not sure that clang should care at all about relocatable output, it is too much of a special case. IMO if you want to link relocatable output, you should call the linker directly.

Mar 5 2017, 4:42 AM

Mar 4 2017

joerg added inline comments to D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase.
Mar 4 2017, 5:33 AM