- Mar 28, 2020
-
-
Yonghong Song authored
Currently, bpf does not specify 128bit alignment in its layout spec. So for a structure like struct ipv6_key_t { unsigned pid; unsigned __int128 saddr; unsigned short lport; }; clang will generate IR type %struct.ipv6_key_t = type { i32, [12 x i8], i128, i16, [14 x i8] } Additional padding is to ensure later IR->MIR can generate correct stack layout with target layout spec. But it is common practice for a tracing program to be first compiled with target flag (e.g., x86_64 or aarch64) through clang to generate IR and then go through llc to generate bpf byte code. Tracing program often refers to kernel internal data structures which needs to be compiled with non-bpf target. But such a compilation model may cause a problem on aarch64. The bcc issue https://github.com/iovisor/bcc/issues/2827 reported such a problem. For the above structure, since aarch64 has "i128:128" in its layout string, the generated IR will have %struct.ipv6_key_t = type { i32, i128, i16 } Since bpf does not have "i128:128" in its spec string, the selectionDAG assumes alignment 8 for i128 and computes the stack storage size for the above is 32 bytes, which leads incorrect code later. The x86_64 does not have this issue as it does not have "i128:128" in its layout spec as it does permits i128 to be alignmented at 8 bytes at stack. Its IR type looks like %struct.ipv6_key_t = type { i32, [12 x i8], i128, i16, [14 x i8] } The fix here is add i128 support in layout spec, the same as aarch64. The only downside is we may have less optimal stack allocation in certain cases since we require 16byte alignment for i128 instead of 8. But this is probably fine as i128 is not used widely and in most cases users should already have proper alignment. Differential Revision: https://reviews.llvm.org/D76587
-
Benjamin Kramer authored
-
Benjamin Kramer authored
-
Reid Kleckner authored
There was already a test case for landingpads to handle this case, but I had forgotten to consider PHI instructions preceding the EH_LABEL in the landingpad. PR45261
-
Nikita Popov authored
To make sure that replaced operands get DCEd. This drops one iteration from gepphigep.ll, which is still not optimal. This was the last test case performing more than 3 iterations. NFC-ish, only worklist order should change.
-
Nikita Popov authored
The `NewGEP->setOperand(DI, NewPN)` call was duplicated, and the insertion of NewGEP is the same in both if/else, so we can extract it.
-
Benjamin Kramer authored
Gets rid of a 150k static initializer (Release clang)
-
Alexandre Ganea authored
Tested on Linux with Clang 9, and on Windows with Visual Studio 2019 16.5.1 with -DLLVM_ENABLE_THREADS=ON and OFF.
-
Nikita Popov authored
Because this code does not use the IC-aware replaceInstUsesWith() helper, we need to manually push users to the worklist. This is NFC-ish, in that it may only change worklist order.
-
Nikita Popov authored
This particular case will stop needing multiple iterations in a followup change.
-
Matt Schulte authored
This fixes PR# 45336. Output sections described in a linker script as NOLOAD with no input sections would be marked as SHT_PROGBITS. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D76981
-
Enna1 authored
This statement if (ReplaceWith == S) ReplaceWith = UndefValue::get(S->getType()); is introduced in https://reviews.llvm.org/rG35609d97ae89b8e13f40f4e6b9b056954f8baa83 to fix a case where unreachable code can cause select instruction simplification to fail. In https://reviews.llvm.org/rGd10480657527ffb44ea213460fb3676a6b1300aa, we begin to perform a depth-first walk of basic blocks. This means we will not visit unreachable blocks. So we do not need this the special check any more. Differential Revision: https://reviews.llvm.org/D76753
-
Martin Storsjö authored
MC already knows how to emulate the .weak directive (with its ELF semantics; i.e., an undefined weak symbol resolves to 0, and a defined weak symbol has lower link precedence than a strong symbol of the same name) using COFF weak externals. Plumb this through the ASM printer too, so that definitions marked with __attribute__((weak)) at the language level (which gets translated to weak linkage at the IR level) have the corresponding .weak directive emitted. Note that declarations marked with __attribute__((weak)) at the language level (which translates to extern_weak at the IR level) already have .weak directives emitted. Weak*/linkonce* symbols without an associated comdat (in particular, ones generated with __attribute__((weak)) in C/C++) were earlier emitted as normal unique globals, as the comdat is required to provide the linkonce semantics. This change makes sure they are emitted as .weak instead, allowing other symbols to override them. Rename the existing coff-weak.ll test to coff-linkonce.ll. I'm not quite sure what that test covers, since the behavior being tested in it (the emission of a one_only section) is just a result of passing -function-sections to llc; the linkonce_odr makes no difference. Add a new coff-weak.ll which tests the new directive emission. Based on an previous patch by Shoaib Meenai. Differential Revision: https://reviews.llvm.org/D44543
-
Alex Brachet authored
The preprocessor reads the whole line even if the first condition of an and is false so this broke when compiling on older gcc versions which don't recognize `__has_builtin`
-
Florian Hahn authored
The LatticeVal alias was introduced to reduce the diff size for the transition to ValueLatticeElement, which is done now. This patch removes the unnecessary alias and updates some very verbose type uses with auto.
-
Florian Hahn authored
LatticeVal is an alias for ValueLatticeElement and the function is not used any longer.
-
Kadir Cetinkaya authored
Reviewers: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75446
-
Raphael Isemann authored
-
Michael Liao authored
-
Michael Liao authored
-
Martin Storsjö authored
This seems to be used in some resource files, e.g. https://github.com/wxWidgets/wxWidgets/blob/f3217573d7240411e7817c9d76d965b2452987a2/include/wx/msw/wx.rc#L28. MSVC rc.exe and GNU windres both allow any value here, and silently just truncate to uint16_t range. This just explicitly allows the -1 value and errors out on others - the same was done for control IDs in dialogs in c1a67857. Differential Revision: https://reviews.llvm.org/D76951
-
Simon Pilgrim authored
-
Simon Pilgrim authored
-
Simon Pilgrim authored
Including some test coverage for PR38522
-
Evan LeClercq authored
I added a list of options to configure should someone have issues with long build time or running out of memory. This was added under common problems in the getting started section of the documentation. Reviewed By: Meinersbur, dim, e-leclercq Differential Revision: https://reviews.llvm.org/D75425
-
Dmitry Vyukov authored
1. Fix expression inside of DCHECK_LE. 2. Add a debug build test to buildgo.sh. 3. Fix race binary path in buildgo.sh.
-
Uday Bondhugula authored
Minor update/fixes to comments for the Attributor pass, and dyn_cast -> cast. Signed-off-by:
Uday Bondhugula <uday@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D76972
-
Siva Chandra Reddy authored
The rule is now called add_object_library. Reviewers: abrachet Differential Revision: https://reviews.llvm.org/D76826
-
Alex Brachet authored
Summary: In preparation for D76818. Reviewers: PaulkaToast, sivachandra, gchatelet Reviewed By: PaulkaToast, sivachandra Subscribers: MaskRay, tschuett, libc-commits Differential Revision: https://reviews.llvm.org/D76967
-
Jason Molenda authored
In ObjectFileMachO we construct the symbol table from multiple sources -- primarily the binary's nlist records, but when the nlist symbols have been stripped, we would augment those with function start address from the LC_FUNCTION_STARTS or eh_frame. This patch adds another source of symbols - the exported symbols that the dynamic linker, dyld, uses at runtime from its trie structure. This provides us names and addresses for these functions/data. This patch removes the code from ParseSymtab that would reject an empty symbol table / nlist source. It adds a new symbols_added set which tracks the address of every symbol we've added to the symtab. We add symbols in most-information-ful order, and before adding a symbol from less-informational-ful source (e.g. LC_FUNCTION_STARTS with no function name), we check if that symbol has already been added. On targets with thumb code generation, instead of using the 0th bit in these addresses in FunctionStarts (or now the trie entries), we use the data field of FunctionStarts (formerly used to track if the func_start should be added) and a flag for the trie entries to encode this, and only store the actual addresses in the symbols_seen and these vectors. <rdar://problem/50791451> Differential revision: https://reviews.llvm.org/D76758
-
Serge Pavlov authored
This change implements constant folding to constrained versions of intrinsics, implementing rounding: floor, ceil, trunc, round, rint and nearbyint. Differential Revision: https://reviews.llvm.org/D72930
-
Yaxun (Sam) Liu authored
The main purpose of introducing these builtins is to add a range metadata [1, 1025) on the work group size loaded from dispatch ptr, which cannot be done by source code. Differential Revision: https://reviews.llvm.org/D76772
-
Richard Smith authored
scope. There are a few contexts in which we assume a name is a template name; if such a context is one where we should perform an unqualified lookup, and lookup finds nothing, we would form a dependent template name even if the name is not dependent. This happens in particular for the lookup of a pseudo-destructor. In passing, rename ActOnDependentTemplateName to just ActOnTemplateName given that we apply it for non-dependent template names too.
-
Mehdi Amini authored
-
Richard Smith authored
required to be a template-id but names an undeclared identifier.
-
Sean Silva authored
Summary: This just bit me and is nasty to debug. Differential Revision: https://reviews.llvm.org/D76888
-
Jonas Devlieghere authored
This reverts commit 8913769e because the unit test is failing on the Windows bot.
-
Ilya Leoshkevich authored
Summary: Commit 5f5fb56c ("[compiler-rt] Intercept the uname() function") broke sanitizer-x86_64-linux and clang-cmake-thumbv7-full-sh (again) builds: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/26313 http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-full-sh/builds/4324 The reason is that uname() can be called as early as __pthread_initialize_minimal_internal(). When intercepted, this triggers ASan initialization, which eventually calls dlerror(), which in turn uses pthreads, causing all sorts of issues. Fix by falling back to internal_uname() when interceptor runs before ASan is initialized. This is only for Linux at the moment. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: dberris, #sanitizers, pcc Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D76919
-
Richard Smith authored
Produce the conventional "to match this '<'" note, so that the user knows why we expected a '>', and properly handle '>>' in C++11 onwards.
-
Uday Bondhugula authored
Move test/lib/TestDialect to test/lib/Dialect/Test - makes the dir structure more uniform. Signed-off-by:
Uday Bondhugula <uday@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D76677
-