summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Codegen] Both sides of '&&' are same; fixedDávid Bolvanský2019-11-021-1/+1
| | | | | | | | | | | | | | | | | Summary: Found by PVS Studio Not familiar with this code; no testcase. Reviewers: craig.topper, RKSimon Reviewed By: RKSimon Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69741
* NoFree argument attribute.Stefan Stipanovic2019-11-0222-185/+370
| | | | | | | | | | | | Summary: Deducing nofree atrribute for function arguments. Reviewers: jdoerfert Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67886
* Fix uninitialized variable warning. NFCI.Simon Pilgrim2019-11-021-1/+1
|
* [X86] Move computeZeroableShuffleElements before ↵Simon Pilgrim2019-11-021-87/+87
| | | | | | getTargetShuffleAndZeroables. NFCI. Prep work toward merging some of the functionality.
* Revert BCmp Loop Idiom recognition transform (PR43870)Roman Lebedev2019-11-026-4028/+8
| | | | | | | | | | | | | | | | | As discussed in https://bugs.llvm.org/show_bug.cgi?id=43870, this transform is missing a crucial legality check: the old (non-countable) loop would early-return upon first mismatch, but there is no such guarantee for bcmp/memcmp. We'd need to ensure that [PtrA, PtrA+NBytes) and [PtrB, PtrB+NBytes) are fully dereferenceable memory regions. But that would limit the transform to constant loop trip counts and would further cripple it because dereferenceability analysis is *very* partial. Furthermore, even if all that is done, every single test would need to be rewritten from scratch. So let's just give up.
* python path should be platform-dependentLuboš Luňák2019-11-021-1/+1
| | | | | | Because one of the installed files is the _lldb.so symlink. Differential Revision: https://reviews.llvm.org/D68910
* [IR] Avoid use of PointerType::getElementType() in one of the CallBrInst ↵Craig Topper2019-11-021-7/+3
| | | | | | | | constructors. We already have the FunctionType we can call getReturnType on. I think this was due to a bad rebase of the CallBr patch while it was in development when CallInst and InvokeInst were updated.
* [X86][NFC] Fix buildbot failure on clang-x64-windows-msvc after commitPengfei Wang2019-11-021-7/+6
| | | | | | | 02728f49da7 Windows uses different VR numbers from Linux. So ignore the number checking in the CHECK.
* [Attributor] Ignore BlockAddress users in call site traversalJohannes Doerfert2019-11-022-0/+29
| | | | | | | BlockAddress users will not "call" the function so they do not qualify as call sites in the first place. When we delete a function with BlockAddress users we need to first remove the body so they are properly discarded.
* [AbstractCallSite][FIX] Correct faulty assertionJohannes Doerfert2019-11-022-1/+2
| | | | | | When the Attributor run on the IPConstantProp test case for multiple callbacks it triggered a faulty assertion in the AbstractCallSite implementation. The callee can well be at argument position 0.
* [X86] Remove FeatureSSE3 from the implies list of HasFastHorizontalOps.Craig Topper2019-11-011-1/+1
| | | | HasFastHorizontalOps is a tuning flag. It shouldn't imply an ISA flag.
* [Attributor][FIX] Do not try to cast if a cast is not requiredJohannes Doerfert2019-11-022-11/+21
| | | | | | | | | When we replace constant returns at the call site we did issue a cast in the hopes it would be a no-op if the types are equal. Turns out that is not the case and we have to check it ourselves first. Reused an IPConstantProp test for coverage. No functional change to the test wrt. IPConstantProp.
* [Attributor][FIX] Transform invoke of nounwind to call + br %normal_destJohannes Doerfert2019-11-022-8/+66
| | | | | | | | | Even if the invoked function may-return, we can replace it with a call and branch if it is nounwind. We had almost everything in place to do this but did not which actually caused a crash when we removed the landingpad from the actually dead unwind block. Exposed by the IPConstantProp tests.
* [Attributor][FIX] Make "known" and "assumed" liveness explicitJohannes Doerfert2019-11-022-23/+45
| | | | | | | | We did merge "known" and "assumed" liveness information into a single set which caused various kinds of problems, especially because we did not properly record when something was actually known. With this patch we properly track the "known" bit and distinguish dead ends we know from the ones we still need to explore in future updates.
* [Attributor] `willreturn` + `noreturn` = UBJohannes Doerfert2019-11-024-9/+16
| | | | | | | | | | | We gave up on `noreturn` if `willreturn` was known for a while but we now again try to always derive `noreturn`. This is useful because a function that is `noreturn` + `willreturn` is basically dead as executing it would lead to undefined behavior (UB). This came up in the IPConstantProp cases where a function only contained a unreachable but was not marked `noreturn` which caused missed opportunities down the line.
* [Attributor][FIX] Make AAValueSimplifyArgument aware of thread-dependent ↵Johannes Doerfert2019-11-022-3/+14
| | | | | | | constants As in IPConstantProp, thread-dependent constants need not be propagated over callbacks. Took the comment and test from there, see also D56447.
* [Attributor][FIX] Handle the default case of a switchJohannes Doerfert2019-11-022-6/+47
| | | | | | In D69605 only the "cases" of a switch were handled but if none matched we did not make the default case life. This is fixed now and properly tested (with code from IPConstantProp/user-with-multiple-uses.ll).
* [Attributor][FIX] Make value simplification aware of "complicated" attributesJohannes Doerfert2019-11-022-1/+101
| | | | | | We cannot simply replace arguments that carry attributes like `nest`, `inalloca`, `sret`, and `byval`. Except for the last one, which we can replace if it is not written, we bail for now.
* [Attributor][NFCI] Avoid unnecessary work except for testingJohannes Doerfert2019-11-0225-45/+85
| | | | | | | | Trying to deduce information for declarations and calls sites of declarations is not useful in practice but only for testing. Add a flag that disables this by default but also enable it in the tests. The misc.ll test will verify the flag "works" as expected.
* [Attributor][FIX] NoCapture is not a subsuming propertyJohannes Doerfert2019-11-022-5/+43
| | | | | | We cannot look at the subsuming positions and take their nocapture bit as shown with the two tests for which we derived nocapture on the call site argument and readonly on the argument of the second before.
* [Attributor][NFCI] Remove obsolete codeJohannes Doerfert2019-11-021-24/+0
| | | | | The code in question does not add anything as the class is a subclass of AACallSiteReturnedFromReturnedAndMustBeExecutedContext already.
* [X86] Model MXCSR for MMX FP instructionsPengfei Wang2019-11-012-5/+29
| | | | | | | | | | | | | | | | Summary: This patch models MXCSR and adds flag "mayRaiseFPException" for MMX FP instructions. Reviewers: craig.topper, andrew.w.kaylor, RKSimon, cameron.mcinally Reviewed By: craig.topper Subscribers: hiraditya, llvm-commits, LiuChen3 Tags: #llvm Differential Revision: https://reviews.llvm.org/D69702
* [X86] add mayRaiseFPException flag and FPCW registers for X87 instructionsPengfei Wang2019-11-014-26/+295
| | | | | | | | | | | | | | | | Summary: This patch adds flag "mayRaiseFPException" , FPCW and FPSW for X87 instructions which could raise float exception. Reviewers: pengfei, RKSimon, andrew.w.kaylor, uweigand, kpn, spatel, cameron.mcinally, craig.topper Reviewed By: craig.topper Subscribers: thakis, hiraditya, llvm-commits Patch by LiuChen. Differential Revision: https://reviews.llvm.org/D68854
* [dsymutil] Second attempt to fix dsymutil tests on non-darwin platformsFrancis Visoiu Mistrih2019-11-011-1/+1
|
* Don't assume that __cxa_current_exception_type exists.Jim Ingham2019-11-011-0/+3
| | | | | | | | | Normally you shouldn't be able to have a process with an ItaniumABI plugin that doesn't have this symbol. But if the loader crashes before loading libc++abi.dylib (on MacOS), then the symbol might not be present. So we should check before accessing the pointer. There isn't a good way to write a test for this, but the change is obvious.
* [dsymutil] Require darwin in fat binary testFrancis Visoiu Mistrih2019-11-011-0/+2
| | | | | | | dsymutil uses lipo(1) to build the fat binary, which it invokes as a process. For that, we need to only run this test on darwin systems. Should fix: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/181/steps/test-check-all/logs/stdio
* [dsymutil] Add support for linking remarksFrancis Visoiu Mistrih2019-11-0124-1/+233
| | | | | | | | | | | | | | | | | | | | This adds support to dsymutil for linking remark files and placing them in the final .dSYM bundle. The result will be placed in: * a.out.dSYM/Contents/Resources/Remarks/a.out or * a.out.dSYM/Contents/Resources/Remarks/a.out-<arch> for universal binaries When multi-threaded, this runs a third thread which loops over all the object files and parses remarks as it finds __remarks sections. Testing this involves running dsymutil on pre-built binaries and object files, then running llvm-bcanalyzer on the final result to check for remarks. Differential Revision: https://reviews.llvm.org/D69142
* DebugInfo: Accept -gdwarf even in clang-clDavid Blaikie2019-11-011-1/+1
| | | | Fixes regression introduced by llvmorg-10-init-8908-g098d901bd1b
* DebugInfo: Let -gdwarf use the toolchain default DWARF version, instead of ↵David Blaikie2019-11-013-7/+9
| | | | hardcoded/aliased to -gdwarf-4
* [NewPM] Add an SROA pass after loop unrollGuozhi Wei2019-11-014-0/+66
| | | | | | | | | | If there is a small local array accessed in a loop, SROA can't handle memory accesses with variant offset inside a loop, after the loop is fully unrolled, all memory accesses to the array are with fixed offset, so now they can be processed by SROA. But there is no more SROA passes after loop unroll. This patch add an SROA pass after loop unroll to handle this pattern. Differential Revision: https://reviews.llvm.org/D68593
* DebugInfo: Streamline debug_ranges/rnglists/rnglists.dwo emission codeDavid Blaikie2019-11-012-47/+23
| | | | | More code reuse, better basis for modelling debug_loc/loclists/loclists.dwo emission support.
* DebugInfo: (NFC) Refactor DWARF version calculation to make a future change ↵David Blaikie2019-11-011-6/+21
| | | | (-fdebug-default-version) easier
* [TargetLowering] Move the setBooleanContents check on (xor (setcc), (setcc)) ↵Craig Topper2019-11-011-8/+13
| | | | | | | | | | | | | | | | | == / != 1 -> (setcc) != / == (setcc) to the right place We need to be checking the value types for the inner setccs not the outer setcc. We need to ensure those setccs produce a 0/1 value or that the xor is on the i1 type. I think at the time this code was originally written, getBooleanContents didn't take any arguments so this was probably correct. But now we can have a different boolean contents for integer and floating point. Not sure why the other combines below the xor were also checking the boolean contents. None of them involve any setccs other than the outer one and they only produce a new setcc. Differential Revision: https://reviews.llvm.org/D69480
* [MachineBasicBlock] Skip over debug instructions in computeRegisterLiveness ↵Craig Topper2019-11-012-1/+6
| | | | | | | | | | | | before checking for begin If there are debug instructions before the stopping point, we need to skip over them before checking for begin in order to avoid having the debug instructions effect behavior. Fixes PR43758. Differential Revision: https://reviews.llvm.org/D69606
* [JT][CVP] Regenerate test checks, againNikita Popov2019-11-015-61/+136
| | | | | The changes to update_test_checks format have been disabled again, so regenerate these tests. Also regenerate select.ll.
* [amdgpu] Fix known bits compuation on `MUL_I24`/`MUL_U24`.Michael Liao2019-11-012-0/+14
| | | | | | | | | | Reviewers: arsenm, rampitec Subscribers: kzhuravl, jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, hiraditya, llvm-commits, yaxunl Tags: #llvm Differential Revision: https://reviews.llvm.org/D69735
* Recommit "[ThinLTO] Handle GUID collision in import global processing""Teresa Johnson2019-11-013-5/+68
| | | | | | | | This recommits cc0b9647b76178bc3869bbfff80535ad86366472 which was reverted in d39d1a2f87aca3cfabe58ecfa5146879baa70096. I added a fix for an issue found when testing via distributed ThinLTO, and added a test case for that failure.
* [WinCFG] Handle constant casts carefully in .gfids emissionReid Kleckner2019-11-012-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The general Function::hasAddressTaken has two issues that make it inappropriate for our purposes: 1. it is sensitive to dead constant users (PR43858 / crbug.com/1019970), leading to different codegen when debu info is enabled 2. it considers direct calls via a function cast to be address escapes The first is fixable, but the second is not, because IPO clients rely on this behavior. They assume this function means that all call sites are analyzable for IPO purposes. So, implement our own analysis, which gets closer to finding functions that may be indirect call targets. Reviewers: ajpaverd, efriedma, hans Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69676
* [NFC]: Removed an implicit capture argument from lambda.Sourabh Singh Tomar2019-11-021-1/+1
|
* [X86] Change the behavior of canWidenShuffleElements used by ↵Craig Topper2019-11-012-19/+51
| | | | | | | | | | | lowerV2X128Shuffle to match the behavior in lowerVectorShuffle with regards to zeroable elements. Previously we marked zeroable elements in a way that prevented the widening check from recognizing that it could widen. Now we only mark them zeroable if V2 is an all zeros vector. This matches what we do for widening elements in lowerVectorShuffle. Fixes PR43866.
* Warn when an output section name is longer than 8 charactersReid Kleckner2019-11-014-2/+25
| | | | | | | | | | | | | | Recent versions of Microsoft's dumpbin tool cannot handle such PE files. LLVM tools and GNU tools can, and use this to encode long section names like ".debug_info", which is commonly used for DWARF. Don't do this in mingw mode or when -debug:dwarf is passed, since the user probably wants long section names for DWARF sections. PR43754 Reviewers: ruiu, mstorsjo Differential Revision: https://reviews.llvm.org/D69594
* [CMake] Add cross Windows to ARM Linux toolchain CMake cache file.Vladimir Vereschaka2019-11-011-0/+109
| | | | | | | This cache file can be used to build a cross Windows to ARM Linux toolchain. Differential Revision: https://reviews.llvm.org/D69651
* Reapply [LLDB] [test] Use %clang_cl instead of build.py in a few testsMartin Storsjö2019-11-012-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows explicitly specifying the intended target architecture, for tests that aren't supposed to be executed, and that don't require MSVC headers or libraries to be available. (These tests already implicitly assumed to be built for x86; one didn't specify anything, assuming x86_64, while the other specified --arch=32, which only picks the 32 bit variant of the default target architecture). Join two comment lines in disassembly.cpp, to keep row numbers checked in the test unchanged. This fixes running check-lldb on arm linux. Previously when this was applied (in 95980409e6), it broke macos buildbots, as they added "-isysroot <path>" to all %clang* substitutions, and clang-cl didn't support that. Reapplying it without further changes to this patch, after D69619 (9c73925226), because now, such extra parameters are added to %clang_host*, but not to plain %clang_cl. Differential Revision: https://reviews.llvm.org/D69031
* [debuginfo-tests] Don't look for Python 3 if we already have itReid Kleckner2019-11-011-25/+34
| | | | | | | | | | | | | LLDB already requires Python 3 on Windows, so I already configure it that way. For some reason CMake fails to find the one that Visual Studio automatically installs at this standard location: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe CMake prefers the python on path, which happens to be python 2.7. Reviewers: aprantl, jmorse Differential Revision: https://reviews.llvm.org/D69684
* [lit] Fix internal env calling envJoel E. Denny2019-11-014-8/+64
| | | | | | | | | | | | | | | | Without this patch, when using lit's internal shell, if `env` on a lit RUN line calls `env`, lit accidentally searches for the latter as an external executable. What's worse is that works fine when a developer is testing on a platform where `env` is available and behaves as expected, but it then breaks on other platforms. `env` calling `env` can make sense if one such `env` is within a lit substitution, as in D65156 and D65121. This patch ensures that lit executes both as internal commands. Reviewed By: probinson, mgorny, rnk Differential Revision: https://reviews.llvm.org/D65697
* [MIPS GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off ↵Fangrui Song2019-11-011-0/+1
| | | | builds after D69663
* Illustrate a redirector using the example of round function from math.h.Siva Chandra Reddy2019-11-0111-5/+247
| | | | | | | | | | | | | | | | | | | | | Setup demonstrated in this patch is only for ELF-ish platforms. Also note: 1. Use of redirectors is a temporary scheme. They will be removed once LLVM-libc has implementations for the redirected functions. 2. Redirectors are optional. One can choose to not include them in the LLVM-libc build for their platform. 3. Even with redirectors used, we want to link to the system libc dynamically. Reviewers: dlj, hfinkel, jakehehrlich, phosek, stanshebs, theraven, alexshap Subscribers: mgorny, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D69020
* [X86][AVX] Add support for and/or scalar bool reduction with AVX512 mask ↵Simon Pilgrim2019-11-012-34/+24
| | | | | | registers combineBitcastvxi1 only handles bitcast->MOVMSK combines, with mask registers we use BITCAST directly.
* [dsymutil] Add DW_TAG_common_block to dieNeedsChildrenToBeMeaningfulJonas Devlieghere2019-11-011-3/+4
| | | | | | | | Ensure we walk the children of common blocks when deciding what DIEs to keep. Otherwise we might incorrectly discard them leading to missing variables in the linked debug info. This also sorts the list of DW_TAGs alphabetically.
* Add MemTagSanitizer documentation.Evgenii Stepanov2019-11-012-0/+103
| | | | | | | | | | | | Summary: A lot of this is work in progress... Reviewers: kcc, pcc Subscribers: cryptoad, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69289
OpenPOWER on IntegriCloud