Page MenuHomePhabricator

joerg (Joerg Sonnenberger)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 23 2012, 10:16 AM (360 w, 3 d)

Recent Activity

Today

joerg committed rGcb92413c5208: Fix -fuse-init-array decision logic on NetBSD (authored by joerg).
Fix -fuse-init-array decision logic on NetBSD
Mon, Oct 21, 4:34 PM
joerg committed rL375468: Fix -fuse-init-array decision logic on NetBSD.
Fix -fuse-init-array decision logic on NetBSD
Mon, Oct 21, 4:33 PM

Tue, Oct 15

joerg added a comment to D68549: make ConstString allocate memory in non-tiny chunks.

I'm a bit puzzled by the need for this change. The bump allocator already has logic to do power-of-two scaling for the allocation, so I wonder why it doesn't work properly here.

Tue, Oct 15, 5:08 PM · Restricted Project

Mon, Oct 14

joerg committed rL374784: Reapply r374743 with a fix for the ocaml binding.
Reapply r374743 with a fix for the ocaml binding
Mon, Oct 14, 9:20 AM
joerg committed rG9681ea9560a0: Reapply r374743 with a fix for the ocaml binding (authored by joerg).
Reapply r374743 with a fix for the ocaml binding
Mon, Oct 14, 9:20 AM

Sun, Oct 13

joerg committed rGe4300c392de2: Add a pass to lower is.constant and objectsize intrinsics (authored by joerg).
Add a pass to lower is.constant and objectsize intrinsics
Sun, Oct 13, 3:59 PM
joerg closed D65280: Add a pass to lower is.constant and objectsize intrinsics.
Sun, Oct 13, 3:59 PM · Restricted Project
joerg committed rL374743: Add a pass to lower is.constant and objectsize intrinsics.
Add a pass to lower is.constant and objectsize intrinsics
Sun, Oct 13, 3:59 PM
joerg committed rG529f4ed401ea: Improve __builtin_constant_p lowering (authored by joerg).
Improve __builtin_constant_p lowering
Sun, Oct 13, 3:39 PM
joerg committed rL374742: Improve __builtin_constant_p lowering.
Improve __builtin_constant_p lowering
Sun, Oct 13, 3:38 PM
joerg closed D67638: Improve __builtin_constant_p lowering.
Sun, Oct 13, 3:38 PM · Restricted Project

Fri, Oct 11

joerg added inline comments to D65280: Add a pass to lower is.constant and objectsize intrinsics.
Fri, Oct 11, 5:07 AM · Restricted Project
joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Adjust based on comments.

Fri, Oct 11, 4:42 AM · Restricted Project

Mon, Oct 7

joerg committed rG2b9f0b064b48: Fix the spelling of my name. (authored by joerg).
Fix the spelling of my name.
Mon, Oct 7, 10:22 PM
joerg committed rL373980: Fix the spelling of my name..
Fix the spelling of my name.
Mon, Oct 7, 10:22 PM
joerg added a comment to D68570: Unify the two CRC implementations.

Why go back to the large tables for crc32? Just because JamCRC had that bug doesn't mean it should persist.

Mon, Oct 7, 7:24 AM · Restricted Project, Restricted Project, Restricted Project

Sat, Oct 5

joerg added a comment to D68410: [AttrDocs] document always_inline.

I wonder if we should actually enumerate evil here, i.e. give the situations in which inlining actually fails. As mentioned on IRC, I wonder if we shouldn't aim for the stronger semantics and at least warn by default of any situation that prevents always_inline from doing its job.

Sat, Oct 5, 4:20 PM · Restricted Project

Thu, Oct 3

joerg added a comment to D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size - 1), d[size - 1] = 0.

I'd make the argument that it should be strlcpy if present. That covers a lot of existing systems too. I'm not sure this optimisation should be done for freestanding mode though.

Thu, Oct 3, 4:24 PM · Restricted Project

Tue, Oct 1

joerg added a comment to D65280: Add a pass to lower is.constant and objectsize intrinsics.

2nd ping. Chandler, care to check this please?

Tue, Oct 1, 1:21 PM · Restricted Project

Sep 21 2019

joerg added a comment to D67638: Improve __builtin_constant_p lowering.

Ping.

Sep 21 2019, 4:51 AM · Restricted Project
joerg updated subscribers of D67638: Improve __builtin_constant_p lowering.
Sep 21 2019, 4:51 AM · Restricted Project
joerg added a comment to D65280: Add a pass to lower is.constant and objectsize intrinsics.

Ping

Sep 21 2019, 4:49 AM · Restricted Project

Sep 16 2019

Herald updated subscribers of D67638: Improve __builtin_constant_p lowering.
Sep 16 2019, 3:16 PM · Restricted Project
joerg created D67638: Improve __builtin_constant_p lowering.
Sep 16 2019, 3:16 PM · Restricted Project
joerg accepted D67628: [compiler-rt][crt] make test case nontrivial in check_cxx_section_exists.

LGTM

Sep 16 2019, 1:46 PM · Restricted Project, Restricted Project
joerg added a comment to D67628: [compiler-rt][crt] make test case nontrivial in check_cxx_section_exists.

Can you declare a volatile variable and set that from f instead?

Sep 16 2019, 11:10 AM · Restricted Project, Restricted Project

Sep 9 2019

joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Switch the pass to use two rounds. The first round will collect all relevant intrinsics in RPO, the second one will translate them accordingly.

Sep 9 2019, 3:41 PM · Restricted Project

Aug 29 2019

joerg committed rG799c96693f68: Allow replaceAndRecursivelySimplify to list unsimplified visitees. (authored by joerg).
Allow replaceAndRecursivelySimplify to list unsimplified visitees.
Aug 29 2019, 6:22 AM
joerg committed rL370355: Allow replaceAndRecursivelySimplify to list unsimplified visitees..
Allow replaceAndRecursivelySimplify to list unsimplified visitees.
Aug 29 2019, 6:22 AM

Aug 28 2019

joerg added inline comments to D65280: Add a pass to lower is.constant and objectsize intrinsics.
Aug 28 2019, 8:03 AM · Restricted Project
joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Apply feedback.

Aug 28 2019, 8:03 AM · Restricted Project

Aug 27 2019

joerg added a comment to D65280: Add a pass to lower is.constant and objectsize intrinsics.

Chandler, are you OK with getting the InstructionSimplify.h part in now, so that it can be merged into 9.0 and the rest follow separately?

Aug 27 2019, 7:06 AM · Restricted Project

Aug 26 2019

joerg added a comment to D66685: Handle UNW_X86_64_RIP in Registers_x86_64.

It would be interesting to get an actual backtrace. It should not be a DWARF register number, but it might be from a direct caller of the unw interface.

Aug 26 2019, 12:55 PM
joerg added a comment to D66618: [WIP] Expose functions to determine pointer properties (Align & Deref).

At least for freestanding environments, it would be useful to separate nonnull completely from deferencable. GCC has a separate flag for it, which might also be a reasonable idea.

Aug 26 2019, 10:20 AM · Restricted Project
joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Hook up a second instance of the pass after the Float To Int pass for optimized builds. This is after the initial loop transforms, so it can profit from some unrolling, but it is before vectorization. The late run of the pass should is kept for now and ensures any potentially added variants are still dropped before SDAG.

Aug 26 2019, 8:23 AM · Restricted Project

Aug 24 2019

joerg added a comment to D66664: [FIX] Nonnull is not always implied by dereferenceable.

It would be nice to also default to this for -ffreestanding.

Aug 24 2019, 11:33 AM · Restricted Project

Aug 23 2019

joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Simplify the pass logic. First round will update the predecessor links and note if any block is orphaned, a second round will remove unreachable blocks if necessary.
The pass can be further refined to use and update DominatorTree and AssumptionCache incrementally, but this should be functionally complete now. It will not handle more complex cases like orphaned loops, but I don't think those are commonly used with is.constant or objectsize conditions either.
The pass will now scan every BB once, but fall back to the start of a BB of recursive removal invalidates the iterator. This seems to be the strictest form I can manage.

Aug 23 2019, 6:29 AM · Restricted Project

Aug 21 2019

joerg added a comment to D53342: [SimplifyLibCalls] Mark known arguments with nonnull.

Please read the discussion. The general consensus was and likely is that this is at least somewhat bogus in the standard at best and the cost of not artificially breaking code is much higher than the benefit. Yes, GCC made different choices, but that's no excuse.

Aug 21 2019, 6:04 AM · Restricted Project
joerg added a comment to D53342: [SimplifyLibCalls] Mark known arguments with nonnull.

Take a look at the list archives for the discussion about attribute nonnull and nullable a while ago. The short version is that the library interface specification might have a wildcard clause that NULL pointers are invalid unless explicitly allowed, but it works perfectly fine on any sensible implementation except the ds9k. When the combination of glibc annotations and aggressive gcc optimizations started, it pointlessly broke a lot of code for no good reason.

Aug 21 2019, 4:31 AM · Restricted Project

Aug 7 2019

joerg accepted D65762: lit: Use a License classifier that pypi will accept.

Thanks, this looks good enough within the limitations of the framework.

Aug 7 2019, 1:20 PM · Restricted Project

Aug 5 2019

joerg added a comment to D65280: Add a pass to lower is.constant and objectsize intrinsics.

Looking a bit more into the details. Chandler, you've originally suggested going with the LowerAtomic route and that actually does create code that fails the SDAG lowering if the pass is skipped, e.g. on ARM.
The second part is currently overlapping with the CodeGenPrepare pass. I can cleanup the implementation somewhat by reusing the same functionality as that pass is using OR I could factor out a minimal branch for doing the constant folding optimization from CodeGenPrepare as a general branch that is included in the pass chain for -O0, e.g. instead of the more general CodeGenPrepare pass. The main difference is that the non-optimized build would not get any recursive folding from PHI-simplification, but I think that's fine for the original use case. It would also not get the block merging, but again, that seems to be fine for the constraints.

Aug 5 2019, 6:55 AM · Restricted Project

Aug 4 2019

joerg added a comment to D65280: Add a pass to lower is.constant and objectsize intrinsics.

For the first part, I was actually asked to do that. I don't mind either way.

Aug 4 2019, 7:31 AM · Restricted Project

Aug 3 2019

joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Generalize slightly to also cover llvm.objectsize which has very similar constraints.

Aug 3 2019, 1:06 PM · Restricted Project

Aug 2 2019

joerg added a comment to D60943: Delay diagnosing asm constraints that require immediates until after inlining.

The combination of D60942, D06943 and D65280 solves the problems for me on all targets I have.

Aug 2 2019, 5:31 AM · Restricted Project, Restricted Project

Aug 1 2019

joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Update PHI nodes in disconnected block.

Aug 1 2019, 11:34 AM · Restricted Project

Jul 30 2019

joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Replace boolean argument to replaceAndRecursivelySimplify with optional vector of un-modified instructions. This simplifies the API change significantly and allows other potential use cases. Redo the restart handling. After a successful simplification step, restart the current BB only, but always do another full pass of the function.

Jul 30 2019, 7:46 AM · Restricted Project

Jul 29 2019

joerg added inline comments to D64963: Add a pass to lower is.constant intrinsics.
Jul 29 2019, 3:08 PM · Restricted Project
joerg added inline comments to D65280: Add a pass to lower is.constant and objectsize intrinsics.
Jul 29 2019, 3:01 PM · Restricted Project
joerg added inline comments to D64963: Add a pass to lower is.constant intrinsics.
Jul 29 2019, 2:45 PM · Restricted Project

Jul 27 2019

joerg updated the diff for D65280: Add a pass to lower is.constant and objectsize intrinsics.

Avoid goto. Create new BranchInst instead of modifying in-place. Update tests to reflect changes. Move most of the x86 is-constant test to generic.

Jul 27 2019, 1:22 PM · Restricted Project
joerg accepted D60942: Emit diagnostic if an inline asm constraint requires an immediate.

LGTM otherwise.

Jul 27 2019, 1:13 PM · Restricted Project
joerg added a comment to D60942: Emit diagnostic if an inline asm constraint requires an immediate.

With the exception of the small improvements outlined, this looks good to me.

Jul 27 2019, 12:01 PM · Restricted Project
joerg committed rG791951bd32ac: Stricter check for the memory access. (authored by joerg).
Stricter check for the memory access.
Jul 27 2019, 11:59 AM
joerg committed rL367180: Stricter check for the memory access..
Stricter check for the memory access.
Jul 27 2019, 11:58 AM
joerg added a comment to D60943: Delay diagnosing asm constraints that require immediates until after inlining.

I understand, but the current version just doesn't work anyway to delay it.

Jul 27 2019, 11:55 AM · Restricted Project, Restricted Project

Jul 26 2019

joerg added inline comments to D60942: Emit diagnostic if an inline asm constraint requires an immediate.
Jul 26 2019, 7:44 AM · Restricted Project

Jul 25 2019

joerg created D65280: Add a pass to lower is.constant and objectsize intrinsics.
Jul 25 2019, 6:54 AM · Restricted Project
joerg abandoned D62025: Expand llvm.is.constant earlier.
Jul 25 2019, 6:47 AM · Restricted Project

Jul 24 2019

joerg added a comment to D60943: Delay diagnosing asm constraints that require immediates until after inlining.

You lost the changes to lib/Sema/SemaStmtAsm.cpp to actually do the delaying for immediate operands?

Jul 24 2019, 3:33 PM · Restricted Project, Restricted Project

Jul 19 2019

joerg added inline comments to D64963: Add a pass to lower is.constant intrinsics.
Jul 19 2019, 5:38 AM · Restricted Project

Jun 7 2019

joerg committed rGb2e96169b0a4: [NFC] Don't export helpers of ConstantFoldCall (authored by joerg).
[NFC] Don't export helpers of ConstantFoldCall
Jun 7 2019, 6:27 AM
joerg committed rL362799: [NFC] Don't export helpers of ConstantFoldCall.
[NFC] Don't export helpers of ConstantFoldCall
Jun 7 2019, 6:27 AM

Jun 5 2019

joerg added a comment to D59744: Fix i386 ABI "__m64" type bug.

I think MMX code is obscure enough at this point that it doesn't matter much either way. Even less across DSO boundaries. That's why I don't really care either way.

Jun 5 2019, 1:22 PM · Restricted Project, Restricted Project
joerg added a comment to D60942: Emit diagnostic if an inline asm constraint requires an immediate.

The patch still needs to be generalized to handle all ICE constraints, but it is not blocked by the review for handling the is.constant intrinsic.

Jun 5 2019, 6:06 AM · Restricted Project

May 30 2019

joerg added inline comments to D60748: Fix i386 struct and union parameter alignment.
May 30 2019, 4:50 AM · Restricted Project

May 16 2019

joerg created D62025: Expand llvm.is.constant earlier.
May 16 2019, 12:25 PM · Restricted Project
joerg committed rGec6ee797ec18: Fix typos in comment. (authored by joerg).
Fix typos in comment.
May 16 2019, 11:01 AM
joerg committed rL360921: Fix typos in comment..
Fix typos in comment.
May 16 2019, 11:01 AM

May 13 2019

joerg added a comment to D60942: Emit diagnostic if an inline asm constraint requires an immediate.

On the frontend side:

  • __builtin_constant_p is not expanded correctly in EvalConstant.cpp when used as part of codegen for -O0. This means that trivially unreachable branches are emitted (e.g. with a BR with a literal false as condition),
  • The constant evaluator has a general problem with overly pessimistic analysis when it comes to possible side effects. Still have to discuss the correct handling with Richard for this.

GCC has this to say about __builtin_constant_p's behavior:

A return of 0 does not indicate that the value is not a constant, but merely that GCC cannot prove it is a constant with the specified value of the -O option.

When I was modifying our implementation recently, I made it so that if there are no optimizations then we evaluate to 0 in the front-end before code-gen. It might be that those blocks are being emitted, but they should have something like br i1 false, label %true_bb, label %false_bb or equivalent.

May 13 2019, 6:11 PM · Restricted Project
joerg added a comment to D60942: Emit diagnostic if an inline asm constraint requires an immediate.

On the frontend side:

  • __builtin_constant_p is not expanded correctly in EvalConstant.cpp when used as part of codegen for -O0. This means that trivially unreachable branches are emitted (e.g. with a BR with a literal false as condition),
  • The constant evaluator has a general problem with overly pessimistic analysis when it comes to possible side effects. Still have to discuss the correct handling with Richard for this.
May 13 2019, 4:54 PM · Restricted Project

Apr 24 2019

joerg committed rG8372b467f18d: [PowerPC] Allow using initial-exec TLS with PIC (authored by joerg).
[PowerPC] Allow using initial-exec TLS with PIC
Apr 24 2019, 3:11 PM
joerg committed rL359146: [PowerPC] Allow using initial-exec TLS with PIC.
[PowerPC] Allow using initial-exec TLS with PIC
Apr 24 2019, 3:11 PM
joerg closed D61026: Fix initial-exec in PIC mode for PPC32.
Apr 24 2019, 3:10 PM · Restricted Project
joerg added a comment to D60942: Emit diagnostic if an inline asm constraint requires an immediate.

It does not fix the issues on our side, but pushes them to a different place. It is still an improvement, but the problem is not solved yet.

Apr 24 2019, 1:43 PM · Restricted Project

Apr 23 2019

joerg created D61026: Fix initial-exec in PIC mode for PPC32.
Apr 23 2019, 9:26 AM · Restricted Project
joerg committed rG6e7cc49d5cb3: [SPARC] Use the correct register set for the "r" asm constraint. (authored by joerg).
[SPARC] Use the correct register set for the "r" asm constraint.
Apr 23 2019, 8:16 AM
joerg committed rL358998: [SPARC] Use the correct register set for the "r" asm constraint..
[SPARC] Use the correct register set for the "r" asm constraint.
Apr 23 2019, 8:13 AM

Apr 22 2019

joerg added a comment to D60943: Delay diagnosing asm constraints that require immediates until after inlining.

I'm in the process of testing this, but feedback will take a bit.

Apr 22 2019, 4:49 AM · Restricted Project, Restricted Project

Mar 27 2019

joerg added inline comments to D59816: [Support] Implement zlib independent crc32 computation.
Mar 27 2019, 6:42 AM · Restricted Project

Mar 26 2019

joerg added a comment to D59816: [Support] Implement zlib independent crc32 computation.

don't bother with the 1KB table in both binary and source, just recompute it on the first use

Is single threaded usage guaranteed?

Mar 26 2019, 8:55 AM · Restricted Project
joerg added a comment to D59816: [Support] Implement zlib independent crc32 computation.

I'd recomment copying the version from libarchive (https://github.com/libarchive/libarchive/blob/master/libarchive/archive_crc32.h):

  • don't bother with the 1KB table in both binary and source, just recompute it on the first use.
  • at least in the past unrolling the inner loop somewhat helped a lot
Mar 26 2019, 6:19 AM · Restricted Project

Mar 11 2019

joerg accepted D28791: [compiler-rt][crt] Simple crtbegin and crtend implementation.

LGTM from my perspective at least.

Mar 11 2019, 2:18 PM · Restricted Project, Restricted Project
joerg added a comment to D59118: creduce script for clang crashes.

For it to be really useful for the majority of bugs, it would be nice to figure out automatically how to get the preprocessing step done and filter out the # lines afterwards. That part alone significantly cuts down the creduce time.

Mar 11 2019, 2:10 PM · Restricted Project
joerg added a comment to D58250: [AIX][CMake] Changes for building on AIX with XL and GCC.

Why do you exclude clang? I would expect LLVM at this point to not support visibility attributes on XCOFF either?

Mar 11 2019, 1:30 PM · Restricted Project

Mar 5 2019

joerg added a comment to D58821: Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890).

Well, that was a sample to illustrate the point. A full working (and now failing) example is:

Mar 5 2019, 5:50 AM · Restricted Project

Mar 4 2019

joerg added a comment to D58821: Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890).

The other problem is that we don't use the CFG machinery to prune dead branches. Consider the x86 in/out instructions: one variant takes an immediate, the other a register. The classic way to deal with that is something like

Mar 4 2019, 3:39 PM · Restricted Project

Mar 2 2019

joerg added a comment to D58821: Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890).

Can you include a patch for something like (int *)0xdeadbeeeeeef on amd64? That's a valid value for "n", but clearly too large for int. Thanks for looking at this, it is one of the two large remaining show stoppers for the asm constraint check.

Mar 2 2019, 12:44 PM · Restricted Project
joerg added a comment to D56828: [ELF] Simplify RelRo, TLS, NOBITS section ranks and make RW PT_LOAD start with RelRo.

Placing .bss.rel.ro before .data doesn't make sense. It forces the content of .bss.rel.ro to embedded into the binary. I also don't really understand the motivation here. Memory mappins on the kernel side are quite cheap.

Mar 2 2019, 10:19 AM · Restricted Project

Feb 28 2019

joerg committed rG01530291eafd: [PPC] Secure PLT only has meaning for PIC (authored by joerg).
[PPC] Secure PLT only has meaning for PIC
Feb 28 2019, 3:34 PM
joerg committed rL355154: [PPC] Secure PLT only has meaning for PIC.
[PPC] Secure PLT only has meaning for PIC
Feb 28 2019, 3:34 PM
joerg added inline comments to D58649: Fix inline assembler constraint validation.
Feb 28 2019, 5:22 AM · Restricted Project

Feb 27 2019

joerg committed rGa9488fbebf94: Ensure that set constrained asm operands are not affected by truncation. (authored by joerg).
Ensure that set constrained asm operands are not affected by truncation.
Feb 27 2019, 4:55 PM
joerg committed rL355058: Ensure that set constrained asm operands are not affected by truncation..
Ensure that set constrained asm operands are not affected by truncation.
Feb 27 2019, 4:54 PM
joerg committed rC355058: Ensure that set constrained asm operands are not affected by truncation..
Ensure that set constrained asm operands are not affected by truncation.
Feb 27 2019, 4:54 PM
joerg committed rG6a198366a0cc: Default to Secure PLT on PPC for NetBSD and OpenBSD. This matches the default… (authored by joerg).
Default to Secure PLT on PPC for NetBSD and OpenBSD. This matches the default…
Feb 27 2019, 1:56 PM
joerg committed rL355038: Default to Secure PLT on PPC for NetBSD and OpenBSD..
Default to Secure PLT on PPC for NetBSD and OpenBSD.
Feb 27 2019, 1:52 PM
joerg committed rGb4a9d3e83e58: Use Secure PLT as default on NetBSD/PowerPC. (authored by joerg).
Use Secure PLT as default on NetBSD/PowerPC.
Feb 27 2019, 1:48 PM
joerg committed rC355033: Use Secure PLT as default on NetBSD/PowerPC..
Use Secure PLT as default on NetBSD/PowerPC.
Feb 27 2019, 1:45 PM
joerg committed rL355033: Use Secure PLT as default on NetBSD/PowerPC..
Use Secure PLT as default on NetBSD/PowerPC.
Feb 27 2019, 1:45 PM

Feb 26 2019

joerg committed rG49ef2a4acdbb: Fix inline assembler constraint validation (authored by joerg).
Fix inline assembler constraint validation
Feb 26 2019, 4:41 PM