- Feb 01, 2019
-
-
Fangrui Song authored
llvm-svn: 352872
-
Fangrui Song authored
llvm-svn: 352871
-
Sanjay Patel authored
If we can reduce the x86-specific intrinsic to the generic op, it allows existing simplifications and value tracking folds. AFAICT, this always results in identical x86 codegen in the non-reduced case...which should be true because we semi-generically (too aggressively IMO) convert to llvm.uadd.with.overflow in CGP, so the DAG/isel must already combine/lower this intrinsic as expected. This isn't quite what was requested in: https://bugs.llvm.org/show_bug.cgi?id=40486 ...but we want to have these kinds of folds early for efficiency and to enable greater simplifications. For the case in the bug report where we have: _addcarry_u64(0, ahi, 0, &ahi) ...this gets completely simplified away in IR. Differential Revision: https://reviews.llvm.org/D57453 llvm-svn: 352870
-
Stefan Granitz authored
Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly. Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille Reviewed By: smeenai Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D57383 llvm-svn: 352869
-
Sam McCall authored
Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D56653 llvm-svn: 352868
-
Adhemerval Zanella authored
This patch changes isFPImmLegal to return if the value can be enconded as the immediate operand of a logical instruction besides checking if for immediate field for fmov. This optimizes some floating point materization, inclusive values used on isinf lowering. Reviewed By: rengolin, efriedma, evandro Differential Revision: https://reviews.llvm.org/D57044 llvm-svn: 352866
-
Eric Liu authored
Clang executable doesn't match clang.* in all test environment. llvm-svn: 352865
-
Sam McCall authored
Summary: LSP now reflects the declaration/definition distinction. Language server changes: - textDocument/definition now returns a definition if one is found, otherwise the declaration. It no longer returns declaration + definition if they are distinct. - textDocument/declaration returns the best declaration we can find. - For macros, the active macro definition is returned for both methods. - For include directive, the top of the target file is returned for both. There doesn't appear to be a discovery mechanism (we can't return everything to clients that only know about definition), so this changes existing behavior. In practice, it should greatly reduce the fraction of the time we need to show the user a menu of options. C++ API changes: - findDefinitions is replaced by locateSymbolAt, which returns a vector<LocatedSymbol> - one for each symbol under the cursor. - this contains the preferred declaration, the definition (if found), and the symbol name This API enables some potentially-neat extensions, like swapping between decl and def, and exposing the symbol name to the UI in the case of multiple symbols. Reviewers: hokein Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57388 llvm-svn: 352864
-
Sam McCall authored
llvm-svn: 352863
-
Ilya Biryukov authored
Summary: Some tidy checks have too many hits in the codebase, making it hard to spot other results from clang-tidy, therefore rendering the tool less useful. Two checks were disabled: - misc-non-private-member-variable-in-classes in the whole LLVM monorepo, it is very common to have those in LLVM and the style guide does not forbid them. - readability-identifier-naming in the clang subtree. There are thousands of violations in 'Sema.h' alone. Before the change, 'Sema.h' had >1000 tidy warnings, after the change the number dropped to 3 warnings (unterminated namespace comments). Reviewers: alexfh, hokein Reviewed By: hokein Subscribers: llvm-commits, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D57573 llvm-svn: 352862
-
Roman Lebedev authored
Summary: I'm unable to find this number in the "AMD SOG for family 15h". llvm-exegesis measures the latencies of these instructions as `2`, which matches the latencies specified in "AMD SOG for family 15h". However if we look at Agner, Microarchitecture, "AMD Bulldozer, Piledriver, Steamroller and Excavator pipeline", "Data delay between different execution domains", the int->ivec transfer is listed as `8`..`10`cy of additional latency. Also, Agner's "Instruction tables", for Piledriver, lists their latencies as `12`, which is consistent with `2cy` from exegesis / AMD SOG + `10cy` transfer delay. Additional data point comes from the fact that Agner's "Instruction tables", for Jaguar, lists their latencies as `8`; and "AMD SOG for family 16h" does state the `+6cy` int->ivec delay, which is consistent with instr latency of `1` or `2`. Reviewers: andreadb, RKSimon, craig.topper Reviewed By: andreadb Subscribers: gbedwell, courbet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57300 llvm-svn: 352861
-
Aleksandr Urakov authored
llvm-svn: 352858
-
Sam McCall authored
llvm-svn: 352857
-
Yevgeny Rouban authored
InlineCost's isInlineViable() is changed to return InlineResult instead of bool. This provides messages for failure reasons and allows to get more specific messages for cases where callsites are not viable for inlining. Reviewed By: xbolva00, anemet Differential Revision: https://reviews.llvm.org/D57089 llvm-svn: 352849
-
James Henderson authored
This was causing a build bot failure: http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/ llvm-svn: 352848
-
James Henderson authored
Prior to this change, there are a few tests called llvm-symbolizer* in the DebugInfo test area. These really were testing either the DebugInfo or Symbolizer library, rather than the llvm-symbolizer tool itself, so this patch renames them to be clearer that they aren't explicitly tests for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer). This patch also reinstates the copying of a DWO file, removed previously in r352752. The test needs this so that it could possibly fail. Finally, some of the tests have been simplified slightly by removing unnecessary switches and/or unused check-prefixes. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57518 llvm-svn: 352847
-
James Henderson authored
A while back, createStringError was added to provide easier construction of StringError instances, especially with formatting options. Prior to this patch, that the documentation only mentions the standard method of using it. Since createStringError is slightly shorter to type, and also provides the formatting options, this patch updates the Programmer's Manual to use the new function in its examples, and to mention the printf formatting options. It also fixes a small typo in one of the examples and removes the unnecessary make_error_code call. llvm-svn: 352846
-
Aleksandr Urakov authored
stored relative to VFRAME Summary: This patch makes LLDB able to retrieve proper values for function arguments and local variables stored in PDB relative to VFRAME register. Patch contains retrieval of corresponding FPO table entries from PDB and a generic translator from FPO programs to DWARF expressions to get correct VFRAME value. Patch also improves variables-locations.test and makes this test passable on x86. Patch By: leonid.mashinsky Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov Reviewed By: zturner Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D55122 llvm-svn: 352845
-
Oliver Stannard authored
Previously, LiveRegUnits was assuming that if a block has no successors and does not return, then no registers are live at the end of it (because the end of the block is unreachable). This was causing the register scavenger to use callee-saved registers to materialise stack frame addresses without saving them in the prologue. This would normally be fine, because the end of the block is unreachable, but this is not legal if the block ends by throwing a C++ exception. If this happens, the scratch register will be modified, but its previous value won't be preserved, so it doesn't get restored by the exception unwinder. Differential revision: https://reviews.llvm.org/D57381 llvm-svn: 352844
-
Roman Lebedev authored
Followup for rL352841. llvm-svn: 352843
-
Sergi Mateo Bellido authored
llvm-svn: 352842
-
Roman Lebedev authored
Else, fails with: [1/2] Linking CXX executable bin/clangd FAILED: bin/clangd : && /usr/bin/g++ -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -pipe -O2 -g0 -UNDEBUG -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined -Wl,-O3 -Wl,--gc-sections tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o tools/clang/tools/extra/clangd/tool/CMakeFiles/clangd.dir/ClangdMain.cpp.o -o bin/clangd -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.so.9svn -lpthread lib/libclangBasic.so.9svn lib/libclangTidy.so.9svn lib/libclangDaemon.so.9svn lib/libclangFormat.so.9svn lib/libclangFrontend.so.9svn lib/libclangSema.so.9svn lib/libclangTooling.so.9svn lib/libclangToolingCore.so.9svn && : ld.lld: error: undefined symbol: clang::FunctionDecl::getBody(clang::FunctionDecl const*&) const >>> referenced by SwapIfBranches.cpp >>> tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o:(clang::FunctionDecl::getBody() const) and so on. llvm-svn: 352841
-
George Rimar authored
These methods are very similar, patch merge them into one. Differential revision: https://reviews.llvm.org/D57461 llvm-svn: 352840
-
Yevgeny Rouban authored
Indices are checked as they are generated. No need to fill the whole array of indices. Differential Revision: https://reviews.llvm.org/D57144 llvm-svn: 352839
-
Serge Guelton authored
Token pasted by the preprocessor (through ##) have a Spelling pointing to scratch buffer. As a result they are not recognized at system macro, even though the pasting happened in a system macro. Fix that by looking into the parent macro if the original lookup finds a scratch buffer. Differential Revision: https://reviews.llvm.org/D55782 This effectively fixes https://bugs.llvm.org/show_bug.cgi?id=35268, llvm-svn: 352838
-
Sam McCall authored
Strings are complicated, giving them opaque names makes us forget they're complicated. llvm-svn: 352837
-
JF Bastien authored
Looks like we still have a few bots that are sad. Let try to get them fixed! llvm-svn: 352835
-
JF Bastien authored
Summary: The RFC on moving past C++11 got good traction: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html This patch therefore bumps the toolchain versions according to our policy: llvm.org/docs/DeveloperPolicy.html#toolchain Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane Differential Revision: https://reviews.llvm.org/D57264 llvm-svn: 352834
-
Alex Bradbury authored
This patch: * Adds necessary RV64D codegen patterns * Modifies CC_RISCV so it will properly handle f64 types (with soft float ABI) Note that in general there is no reason to try to select fcvt.w[u].d rather than fcvt.l[u].d for i32 conversions because fptosi/fptoui produce poison if the input won't fit into the target type. Differential Revision: https://reviews.llvm.org/D53237 llvm-svn: 352833
-
Alex Bradbury authored
For targets where i32 is not a legal type (e.g. 64-bit RISC-V), LegalizeIntegerTypes must promote the integer operand of ISD::FPOWI. As this is a signed value, this should be sign-extended. This patch enables all tests in test/CodeGen/RISCVfloat-intrinsics.ll for RV64, as prior to this patch that file couldn't be compiled for RV64 due to an assertion when performing codegen for fpowi. Differential Revision: https://reviews.llvm.org/D54574 llvm-svn: 352832
-
Brian Gesiak authored
Summary: Given the following test program: ``` class C { public: int A(int a, int& b); }; int C::A(const int a, int b) { return a * b; } ``` Clang would produce an error message that correctly diagnosed the redeclaration of `C::A` to not match the original declaration (the parameters to the two declarations do not match -- the original takes an `int &` as its 2nd parameter, but the redeclaration takes an `int`). However, it also produced a note diagnostic that inaccurately pointed to the first parameter, claiming that `const int` in the redeclaration did not match the unqualified `int` in the original. The diagnostic is misleading because it has nothing to do with why the program does not compile. The logic for checking for a function overload, in `Sema::FunctionParamTypesAreEqual`, discards cv-qualifiers before checking whether the types are equal. Do the same when producing the overload diagnostic. Reviewers: rsmith Reviewed By: rsmith Subscribers: cpplearner, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57032 llvm-svn: 352831
-
James Y Knight authored
Who knew...they're not built by default or as part of the tests. llvm-svn: 352830
-
Julian Lettner authored
Summary: UBSan wants to detect when unreachable code is actually reached, so it adds instrumentation before every unreachable instruction. However, the optimizer will remove code after calls to functions marked with noreturn. To avoid this UBSan removes noreturn from both the call instruction as well as from the function itself. Unfortunately, ASan relies on this annotation to unpoison the stack by inserting calls to _asan_handle_no_return before noreturn functions. This is important for functions that do not return but access the the stack memory, e.g., unwinder functions *like* longjmp (longjmp itself is actually "double-proofed" via its interceptor). The result is that when ASan and UBSan are combined, the noreturn attributes are missing and ASan cannot unpoison the stack, so it has false positives when stack unwinding is used. Changes: Clang-CodeGen now directly insert calls to `__asan_handle_no_return` when a call to a noreturn function is encountered and both UBsan-unreachable and ASan are enabled. This allows UBSan to continue removing the noreturn attribute from functions without any changes to the ASan pass. Previously generated code: ``` call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable ``` Generated code (for now): ``` call void @__asan_handle_no_return call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable ``` rdar://problem/40723397 Reviewers: delcypher, eugenis, vsk Differential Revision: https://reviews.llvm.org/D57278 > llvm-svn: 352690 llvm-svn: 352829
-
Sam Clegg authored
Fixes: https://bugs.llvm.org/show_bug.cgi?id=37168 This is only a first pass at supporting these custom import modules. In the long run we most likely want to treat these kinds of symbols very differently. For example, it should not be possible to resolve such as symbol at static link type. Differential Revision: https://reviews.llvm.org/D45796 llvm-svn: 352828
-
James Y Knight authored
Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc doesn't choke on it, hopefully. Original Message: The FunctionCallee type is effectively a {FunctionType*,Value*} pair, and is a useful convenience to enable code to continue passing the result of getOrInsertFunction() through to EmitCall, even once pointer types lose their pointee-type. Then: - update the CallInst/InvokeInst instruction creation functions to take a Callee, - modify getOrInsertFunction to return FunctionCallee, and - update all callers appropriately. One area of particular note is the change to the sanitizer code. Previously, they had been casting the result of `getOrInsertFunction` to a `Function*` via `checkSanitizerInterfaceFunction`, and storing that. That would report an error if someone had already inserted a function declaraction with a mismatching signature. However, in general, LLVM allows for such mismatches, as `getOrInsertFunction` will automatically insert a bitcast if needed. As part of this cleanup, cause the sanitizer code to do the same. (It will call its functions using the expected signature, however they may have been declared.) Finally, in a small number of locations, callers of `getOrInsertFunction` actually were expecting/requiring that a brand new function was being created. In such cases, I've switched them to Function::Create instead. Differential Revision: https://reviews.llvm.org/D57315 llvm-svn: 352827
-
Fangrui Song authored
Summary: In ld.bfd/gold, --no-allow-shlib-undefined is the default when linking an executable. This patch implements a check to error on undefined symbols in a shared object, if all of its DT_NEEDED entries are seen. Our approach resembles the one used in gold, achieves a good balance to be useful but not too smart (ld.bfd traces all DSOs and emulates the behavior of a dynamic linker to catch more cases). The error is issued based on the symbol table, different from undefined reference errors issued for relocations. It is most effective when there are DSOs that were not linked with -z defs (e.g. when static sanitizers runtime is used). gold has a comment that some system libraries on GNU/Linux may have spurious undefined references and thus system libraries should be excluded (https://sourceware.org/bugzilla/show_bug.cgi?id=6811). The story may have changed now but we make --allow-shlib-undefined the default for now. Its interaction with -shared can be discussed in the future. Reviewers: ruiu, grimar, pcc, espindola Reviewed By: ruiu Subscribers: joerg, emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D57385 llvm-svn: 352826
-
Sam Clegg authored
Differential Revision: https://reviews.llvm.org/D57555 llvm-svn: 352825
-
George Karpenkov authored
Having an incorrect type for a cast causes the checker to incorrectly dismiss the operation under ARC, leading to a false positive use-after-release on the test. rdar://47709885 Differential Revision: https://reviews.llvm.org/D57557 llvm-svn: 352824
-
Peter Collingbourne authored
Should fix non-lld links. llvm-svn: 352823
-
Akira Hatanaka authored
This reverts commit r350920 as it is not clear whether we should force a class to be returned in registers when copy and move constructors are both deleted. For more background, see the following discussion: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190128/259907.html llvm-svn: 352822
-