- Jun 02, 2021
-
-
Peyton, Jonathan L authored
-
Daniel McIntosh authored
In 07ef8e67 and 3ed9f6eb, `__nbuf` started to diverge from the amount of space that was actually needed for the buffer. For 32-bit longs for example, we allocate a buffer that is one larger than needed. Moreover, it is no longer clear exactly where the extra +1 or +2 comes from - they're just numbers pulled from thin air. This PR cleans up how `__nbuf` is calculated, and adds comments to further clarify where each part comes from. Specifically, it corrects the underestimation of the max size buffer needed that the above two commits had to compensate for. The root cause looks to be the use of signed type parameters to numeric_limits<>::digits. Since digits only counts non-sign bits, the calculation was acting as though (for a signed 64-bit type) the longest value we would print was 2^63 in octal. However, printing in octal treats values as unsigned, so it is actually 2^64. Thus, using unsigned types and changing the final +2 to a +1 is probably a better option. Reviewed By: #libc, ldionne, Mordante Differential Revision: https://reviews.llvm.org/D103339
-
Nico Weber authored
My linux system doesn't like the `grep` for some reason, but FileCheck seems to work.
-
Hansang Bae authored
Differential Revision: https://reviews.llvm.org/D103464
-
Nico Weber authored
Also adds support for live_support sections, no_dead_strip sections, .no_dead_strip symbols. Chromium Framework 345MB unstripped -> 250MB stripped (vs 290MB unstripped -> 236M stripped with ld64). Doing dead stripping is a bit faster than not, because so much less data needs to be processed: % ministat lld_* x lld_nostrip.txt + lld_strip.txt N Min Max Median Avg Stddev x 10 3.929414 4.07692 4.0269079 4.0089678 0.044214794 + 10 3.8129408 3.9025559 3.8670411 3.8642573 0.024779651 Difference at 95.0% confidence -0.144711 +/- 0.0336749 -3.60967% +/- 0.839989% (Student's t, pooled s = 0.0358398) This interacts with many parts of the linker. I tried to add test coverage for all added `isLive()` checks, so that some test will fail if any of them is removed. I checked that the test expectations for the most part match ld64's behavior (except for live-support-iterations.s, see the comment in the test). Interacts with: - debug info - export tries - import opcodes - flags like -exported_symbol(s_list) - -U / dynamic_lookup - mod_init_funcs, mod_term_funcs - weak symbol handling - unwind info - stubs - map files - -sectcreate - undefined, dylib, common, defined (both absolute and normal) symbols It's possible it interacts with more features I didn't think of, of course. I also did some manual testing: - check-llvm check-clang check-lld work with lld with this patch as host linker and -dead_strip enabled - Chromium still starts - Chromium's base_unittests still pass, including unwind tests Implemenation-wise, this is InputSection-based, so it'll work for object files with .subsections_via_symbols (which includes all object files generated by clang). I first based this on the COFF implementation, but later realized that things are more similar to ELF. I think it'd be good to refactor MarkLive.cpp to look more like the ELF part at some point, but I'd like to get a working state checked in first. Mechanical parts: - Rename canOmitFromOutput to wasCoalesced (no behavior change) since it really is for weak coalesced symbols - Add noDeadStrip to Defined, corresponding to N_NO_DEAD_STRIP (`.no_dead_strip` in asm) Fixes PR49276. Differential Revision: https://reviews.llvm.org/D103324
-
Nico Weber authored
These allow overriding dead_strip_dylibs. Differential Revision: https://reviews.llvm.org/D103499
-
Nico Weber authored
Noticed by Jez in D103499. Differential Revision: https://reviews.llvm.org/D103521
-
Stephen Tozer authored
During Loop Strength Reduce, if the terminating condition for the loop is not immediately adjacent to the terminating branch and it has more than one use, a clone of the condition will be created just before the terminating branch and will be used as the branch condition. Currently, whether the instructions are "immediately adjacent" is determined by checking whether the next instruction after the condition is the terminating branch; this is incorrect however, as the presence of a debug intrinsic between the two will result in a change to the output. This is fixed by using getNextNonDebugInstruction() instead. Differential Revision: https://reviews.llvm.org/D103033
-
Nico Weber authored
I forgot to move the message() call around as requested in D103428 before committing that change. Move it now. Also, improve the ordinal uniq'ing comment. I hadn't realized that the distinct-but-identical files happen with --reproduce and not in general. No behavior change. Differential Revision: https://reviews.llvm.org/D103522
-
Arnold Schwaighofer authored
Transfer the swiftasync attribute to the resume partial function according to suspend.async specification. It's first argument denotes which argument is the async context. rdar://71499498 Differential Revision: https://reviews.llvm.org/D103285
-
Erik Pilkington authored
This attribute applies to a using declaration, and permits importing a declaration without knowing if that declaration exists. This is useful for libc++ C wrapper headers that re-export declarations in std::, in cases where the base C library doesn't provide all declarations. This attribute was proposed in http://lists.llvm.org/pipermail/cfe-dev/2020-June/066038.html. rdar://69313357 Differential Revision: https://reviews.llvm.org/D90188
-
David Goldman authored
This allows us to differentiate symbols from the system (e.g. system includes or sysroot) differently than symbols defined in the user's project, which can be used by editors to display them differently. This is currently based on `FileCharacteristic`, but we can consider alternatives such as `Sysroot` and file paths in the future. Differential Revision: https://reviews.llvm.org/D101554
-
Yaxun (Sam) Liu authored
-
Qunyan Mangus authored
Add getDemandedBits method for uses so we can query demanded bits for each use. This can help getting better use information. For example, for the code below define i32 @test_use(i32 %a) { %1 = and i32 %a, -256 %2 = or i32 %1, 1 %3 = trunc i32 %2 to i8 (didn't optimize this to 1 for illustration purpose) ... some use of %3 ret %2 } if we look at the demanded bit of %2 (which is all 32 bits because of the return), we would conclude that %a is used regardless of how its return is used. However, if we look at each use separately, we will see that the demanded bit of %2 in trunc only uses the lower 8 bits of %a which is redefined, therefore %a's usage depends on how the function return is used. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D97074
-
Irina Dobrescu authored
-
Sander de Smalen authored
This patch uses the calculated maximum scalable VFs to build VPlans, cost them and select a suitable scalable VF. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D98722
-
David Spickett authored
We have been seeing this test fail intermittently on our 2 stage AArch64 bot. As far back as https://lab.llvm.org/buildbot/#/builders/53/builds/2694 Likely due to a lack of resources at certain times on the shared machine. Up the time limit to give us some more room. (this limit only applies to the watchdog thread, so if the test passes then it won't take 20s)
-
Sean Fertile authored
A recent patch: https://reviews.llvm.org/rGe0921655b1ff8d4ba7c14be59252fe05b705920e changed clangs AIX bitfield handling to use 4-byte bitfield containers, matching XLs behavior. This change triggers static assert failures when bootstrapping. Change the macro we check to enable bitfield packing on AIX to `__clang__` which is defined by both xlclang and clang. Differential Revision: https://reviews.llvm.org/D103474
-
Sander de Smalen authored
This NFC change follows from conversation in D102437, where it was discussed to remove these functions as a separate patch.
-
Sander de Smalen authored
llvm::getLoadStoreType was added recently and has the same implementation as 'getMemInstValueType' in LoopVectorize.cpp. Since there is no value in having two implementations, this patch removes the custom LV implementation in favor of the generic one defined in Instructions.h.
-
Daniil Fukalov authored
This patch migrates the TTI cost interfaces to return an InstructionCost. See this patch for the introduction of the type: https://reviews.llvm.org/D91174 See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D102915
-
David Spickett authored
Since https://reviews.llvm.org/D102046 some tests have been falling back to fast unwinding on our Thumb bot. This fails because fast unwinding does not work on Thumb. By adding the extra information we ensure this does not happen during testing, but the built library can still fast unwind as a last resort. Since there are some situations it can work in, like if eveything is built with clang. During testing we've got gcc built system libs and clang built tests. The same change was made for sanitizer-common in https://reviews.llvm.org/D96337. Reviewed By: zatrazz Differential Revision: https://reviews.llvm.org/D103463
-
Tobias Gysi authored
Remove two unused methods and replace the implementation of getResultsPositionInLoopsToShapeMap. The patch is based on https://reviews.llvm.org/D103394. Differential Revision: https://reviews.llvm.org/D103397
-
Tobias Gysi authored
Replace the uses of deprecated Structured Op Interface methods in FusionOnTensors.cpp. This patch is based on https://reviews.llvm.org/D103394. Differential Revision: https://reviews.llvm.org/D103471
-
Fraser Cormack authored
-
Irina Dobrescu authored
Differential Revision: https://reviews.llvm.org/D103105
-
Pushpinder Singh authored
Dropped structs are atmi_machine_t, atmi_device_t and atmi_memory_t Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D103509
-
Nico Weber authored
These are slightly easier-to-use versions of -sub_library and -sub_umbrella. Differential Revision: https://reviews.llvm.org/D103497
-
Pushpinder Singh authored
atmi_place_t has been replaced with int DeviceId. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D103508
-
Nico Weber authored
-
Nico Weber authored
See "Proposal: Adding a toplevel .mailmap file" on llvm-dev: https://lists.llvm.org/pipermail/llvm-dev/2021-May/150741.html Differential Revision: https://reviews.llvm.org/D103360
-
Jingu Kang authored
This re-enables commit 107d19eb with bug fixes. Differential Revision: https://reviews.llvm.org/D99354
-
Bjorn Pettersson authored
This is a pre-commit of a test case D99439 which is a patch that updates @llvm.powi to handle different int sizes for the exponent. Problem is that @llvm.powi is used as an IR construct that maps to RT libcalls to __powi* functions, and those lib functions depend on sizeof(int) to use correct type for the exponent. The test cases show that we use i32 for the powi expenent, which later would result in wrong type being used in libcalls (miscompile). But there are also a couple of the negative test cases that show that we rewrite into using powi when having a uitofp conversion from i16, which would be wrong when doing the libcall as an "unsigned int" isn't guaranteed to fit inside the "int" argument in the called libcall function. Differential Revision: https://reviews.llvm.org/D102919
-
Bjorn Pettersson authored
Use RuntimeLibcalls to get a common way to pick correct RTLIB::POWI_* libcall for a given value type. This includes a small refactoring of ExpandFPLibCall and ExpandArgFPLibCall in SelectionDAGLegalize to share a bit of code, plus adding an ExpandFPLibCall version that can be called directly when expanding FPOWI/STRICT_FPOWI to ensure that we actually use the same RTLIB::Libcall when expanding the libcall as we used when checking the legality of such a call by doing a getLibcallName check. Differential Revision: https://reviews.llvm.org/D103050
-
Bjorn Pettersson authored
The FPOWI DAG node is normally lowered to a libcall to one of the RTLIB::POWI* runtime functions and the exponent should normally have a type matching sizeof(int) when making the call. Thus, type promotion of the exponent could lead to an FPOWI with a type for the second operand that would be incorrect when doing the libcall (a situation which would be hard to detect post-legalization if we allow such FPOWI nodes). This patch is changing DAGTypeLegalizer::PromoteIntOp_FPOWI to do the rewrite into a libcall directly instead of promoting the operand. This way we can check that the exponent is smaller than sizeof(int) and we can let TargetLowering handle promotion as part of making the libcall. It could be noticed here that makeLibCall has some knowledge about targets such as 64-bit RISCV, for which the libcall argument should be extended to a type larger than sizeof(int). Differential Revision: https://reviews.llvm.org/D102950
-
Bjorn Pettersson authored
When rewriting powf(2.0, itofp(x)) -> ldexpf(1.0, x) exp2(sitofp(x)) -> ldexp(1.0, sext(x)) exp2(uitofp(x)) -> ldexp(1.0, zext(x)) the wrong type was used for the second argument in the ldexp/ldexpf libc call, for target architectures with 16 bit "int" type. The transform incorrectly used a bitcasted function pointer with a 32-bit argument when emitting the ldexp/ldexpf call for such targets. The fault is solved by using the correct function prototype in the call, by asking TargetLibraryInfo about the size of "int". TargetLibraryInfo by default derives the size of the int type by assuming that it is 16 bits for 16-bit architectures, and 32 bits otherwise. If this isn't true for a target it should be possible to override that default in the TargetLibraryInfo initializer. Differential Revision: https://reviews.llvm.org/D99438
-
Adrian Kuegel authored
Differential Revision: https://reviews.llvm.org/D103507
-
Tomasz Miąsko authored
Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D102729
-
Fraser Cormack authored
RVV vectors must be aligned to their element types, so anything less is unaligned. For regular loads and stores, our custom-lowering of fixed-length vectors meant that we opted out of LegalizeDAG's built-in unaligned expansion. This patch adds that logic in to our custom lower function. For masked intrinsics, we declare that anything unaligned is not legal, leaving the ScalarizeMaskedMemIntrin pass to do the expansion for us. Note that neither of these methods can handle the expansion of scalable-vector memory ops, so those cases are left alone by this patch. Scalable loads and stores already go through expansion by default but hit an assertion, and scalable masked intrinsics will silently generate incorrect code. It may be prudent to return an error in both of these cases. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D102493
-
Diana Picus authored
These should already pass with the current implementation. Differential Revision: https://reviews.llvm.org/D103402
-