summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Exploit a zero LoopExit count to eliminate loop exitsPhilip Reames2019-06-223-6/+17
| | | | | | | | | | This turned out to be surprisingly effective. I was originally doing this just for completeness sake, but it seems like there are a lot of cases where SCEV's exit count reasoning is stronger than it's isKnownPredicate reasoning. Once this is in, I'm thinking about trying to build on the same infrastructure to eliminate provably untaken checks. There may be something generally interesting here. Differential Revision: https://reviews.llvm.org/D63618 llvm-svn: 364135
* [CommandLine] Remove OptionCategory and SubCommand caches from the Option class.Don Hinton2019-06-223-95/+118
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change processes `OptionCategory`s and `SubCommand`s as they are seen instead of caching them in the Option class and processing them later. Doing so simplifies the work needed to be done by the Global parser and significantly reduces the size of the Option class to a mere 64 bytes. Removing the `OptionCategory` cache saved 24 bytes, and removing the `SubCommand` cache saved an additional 48 bytes, for a total of a 72 byte reduction. Reviewers: beanz, zturner, MaskRay, serge-sans-paille Reviewed By: serge-sans-paille Subscribers: serge-sans-paille, tstellar, zturner, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62105 llvm-svn: 364134
* [NFC] Fix indentation in PPCAsmPrinter.cppHubert Tong2019-06-221-54/+54
| | | | | | | | After r248261, the indentation switches, inside a namespace definition, between indenting and not indenting one level in for that namespace; the abomination occurs in the middle of a class definition. Fix that. llvm-svn: 364133
* [PowerPC][NFC] Move comment to the relevant functionHubert Tong2019-06-221-1/+1
| | | | | | | A comment that applies to a virtual destructor was placed on a class constructor. Move the comment to where it belongs. llvm-svn: 364132
* PDB docs: Delete trailing whitespace, wrap to 80 colsNico Weber2019-06-225-76/+82
| | | | llvm-svn: 364131
* [NewGVN] Fix copy/paste mistake in castNikita Popov2019-06-221-1/+1
| | | | llvm-svn: 364130
* [NewGVN] Remove dead SwitchEdges variable; NFCNikita Popov2019-06-221-4/+0
| | | | llvm-svn: 364129
* [LFTR] Add tests for PR41998; NFCNikita Popov2019-06-221-0/+73
| | | | | | The limit for the pointer case is incorrect. llvm-svn: 364128
* [X86] Don't use _MM_FROUND_CUR_DIRECTION in the intrinsics tests.Craig Topper2019-06-224-390/+390
| | | | | | | | | | _MM_FROUND_CUR_DIRECTION is the behavior of the intrinsics that don't take a rounding mode argument. So a better test is using _MM_FROUND_NO_EXC with the SAE only intrinsics and an explicit rounding mode with the intrinsics that support embedded rounding mode. llvm-svn: 364127
* AArch64: Add support for reading pc using llvm.read_register.Peter Collingbourne2019-06-222-0/+19
| | | | | | | | | | | | | | | This is useful for allowing code to efficiently take an address that can be later mapped onto debug info. Currently the hwasan pass achieves this by taking the address of the current function: http://llvm-cs.pcc.me.uk/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp#921 but this costs two instructions (plus a GOT entry in PIC code) per function with stack variables. This will allow the cost to be reduced to a single instruction. Differential Revision: https://reviews.llvm.org/D63471 llvm-svn: 364126
* [CMake] Delete redundant DEPENDS/LINK_LIBS from LineEditor/XRayFangrui Song2019-06-222-9/+0
| | | | | | The link dependencies are already specified in LLVMBuild.txt llvm-svn: 364125
* Make GlobalISel depend on SelectionDAG after D63169Fangrui Song2019-06-221-1/+1
| | | | | | | | | | | GlobalISel/IRTranslator.cpp now references SelectionDAG/FunctionLoweringInfo.cpp. This fixes a link error in -DBUILD_SHARED_LIBS=on builds: ld.lld: error: undefined symbol: llvm::FunctionLoweringInfo::clear() >>> referenced by IRTranslator.cpp:2198 (../lib/CodeGen/GlobalISel/IRTranslator.cpp:2198) >>> lib/CodeGen/GlobalISel/CMakeFiles/LLVMGlobalISel.dir/IRTranslator.cpp.o:(llvm::IRTranslator::finalizeFunction()) llvm-svn: 364124
* AMDGPU: Fix target builtins for gfx10Matt Arsenault2019-06-228-3/+14
| | | | | | This wasn't setting some of the features from older generations. llvm-svn: 364123
* Fix UNSUPPORTED attribute from windows to system-windows.Douglas Yung2019-06-221-1/+1
| | | | llvm-svn: 364122
* [llvm-objdump] Allow --disassemble-functions to take demangled namesYuanfang Chen2019-06-223-36/+71
| | | | | | | | | | | | | The --disassemble-functions switch takes demangled names when --demangle is specified, otherwise the switch takes mangled names. https://bugs.llvm.org/show_bug.cgi?id=41908 Reviewers: jhenderson, grimar, MaskRay, rupprecht Differential Revision: https://reviews.llvm.org/D63524 llvm-svn: 364121
* [NFC] Marking test added in r363975 as unsupported on Windows.Douglas Yung2019-06-221-0/+2
| | | | | | | | This test references a path that does not exist on Windows causing it to emit different output from what was expected leading to a failure when run on Windows. llvm-svn: 364120
* [ODRHash] Skip some typedef types.Richard Trieu2019-06-222-1/+107
| | | | | | | | | | | | | | | In some cases, a typedef only strips aways a keyword for a type, keeping the same name as the root record type. This causes some confusion when the type is defined in one modules but only forward declared in another. Skipping the typedef and going straight to the record will avoid this issue. typedef struct S {} S; S* s; // S is TypedefType here struct S; S* s; // S is RecordType here llvm-svn: 364119
* [llvm-objdump] Move --start-address >= --stop-address check out of theYuanfang Chen2019-06-222-5/+5
| | | | | | | | | | | | | | | | | | | | -d code. Summary: Move it into `main` function so the checking is effective for all actions user may do with llvm-objdump; notably, -r and -s in addition to existing -d. Match GNU behavior. Reviewers: jhenderson, grimar, MaskRay, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63631 llvm-svn: 364118
* AArch64: Prefer FP-relative debug locations in HWASANified functions.Peter Collingbourne2019-06-224-11/+59
| | | | | | | | | | | | | | | | | | | | To help produce better diagnostics for stack use-after-return, we'd like to be able to determine the addresses of each HWASANified function's local variables given a small amount of information recorded on entry to the function. Currently we require all HWASANified functions to use frame pointers and record (PC, FP) on function entry. This works better than recording SP because FP cannot change during the function, unlike SP which can change e.g. due to dynamic alloca. However, most variables currently end up using SP-relative locations in their debug info. This prevents us from recomputing the address of most variables because the distance between SP and FP isn't recorded in the debug info. To address this, make the AArch64 backend prefer FP-relative debug locations when producing debug info for HWASANified functions. Differential Revision: https://reviews.llvm.org/D63300 llvm-svn: 364117
* gn build: Merge r364046.Peter Collingbourne2019-06-221-0/+1
| | | | llvm-svn: 364116
* [COFF, ARM64] Fix encoding of debugtrap for WindowsTom Tan2019-06-215-0/+30
| | | | | | | | | | | | On Windows ARM64, intrinsic __debugbreak is compiled into brk #0xF000 which is mapped to llvm.debugtrap in Clang. Instruction brk #F000 is the defined break point instruction on ARM64 which is recognized by Windows debugger and exception handling code, so llvm.debugtrap should map to it instead of redirecting to llvm.trap (brk #1) as the default implementation. Differential Revision: https://reviews.llvm.org/D63635 llvm-svn: 364115
* Add new style meta-programming primatives.Eric Fiselier2019-06-213-28/+245
| | | | | | | | | | | | | Using class templates instead of alias templates causes a lot of instantiations. As part of the move away from C++03, we want to improve the efficiency of our meta-programming. This patch lays the groundwork by introducing new _If, _EnableIf, _And, _Or, and _IsValidExpansion (detect member). Future patches will replace the existing implementations after verifying there compile time differences. llvm-svn: 364114
* [lit] Deduplicate logic in toolchain.pyJonas Devlieghere2019-06-211-6/+4
| | | | | | No need to compute the path of lit-lldb-init twice. llvm-svn: 364113
* [lit] Make lit-lldb-init configurable by CMakeJonas Devlieghere2019-06-213-2/+6
| | | | | | | | | | This makes the `lit-lldb-init` file configurable by CMake. This matters to us downstream in Swift, where we want to set environment variables with the `env` command for every test. Differential revision: https://reviews.llvm.org/D63679 llvm-svn: 364112
* Revert [SLP] Look-ahead operand reordering heuristic.Reid Kleckner2019-06-212-276/+93
| | | | | | | | | This reverts r364084 (git commit 5698921be2d567f6abf925479ac9f5a376d6d74f) It caused crashes while compiling a file in Chrome. Reduction forthcoming. llvm-svn: 364111
* Remove binary finally accidentially committed in r364109Erich Keane2019-06-211-0/+0
| | | | llvm-svn: 364110
* Ensure Target Features always_inline error happens in C++ cases.Erich Keane2019-06-216-13/+37
| | | | | | | | A handful of C++ cases as reported in PR42352 didn't actually give an error when always_inlining with a different target feature list. This resulted in broken IR. llvm-svn: 364109
* Fix has_attribute.cpp test on Windows after r364102Reid Kleckner2019-06-211-2/+2
| | | | llvm-svn: 364108
* [llvm-lipo] Implement -thinShoaib Meenai2019-06-218-5/+489
| | | | | | | | | | Creates thin output file of specified arch_type from the fat input file. Patch by Anusha Basana <anushabasana@fb.com> Differential Revision: https://reviews.llvm.org/D63341 llvm-svn: 364107
* [clang-tidy] misc-unused-parameters: don't comment out parameter name for C codeMatthias Gehre2019-06-212-5/+10
| | | | | | | | | | | | | | Summary: The fixit `int square(int /*num*/)` yields `error: parameter name omitted` for C code. Enable it only for C++ code. Reviewers: klimek, ilya-biryukov, lebedev.ri, aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63088 llvm-svn: 364106
* [ASan] Use dynamic shadow on 32-bit iOS and simulatorsJulian Lettner2019-06-214-41/+53
| | | | | | | | | | | | | | | | | | | | The VM layout on iOS is not stable between releases. On 64-bit iOS and its derivatives we use a dynamic shadow offset that enables ASan to search for a valid location for the shadow heap on process launch rather than hardcode it. This commit extends that approach for 32-bit iOS plus derivatives and their simulators. rdar://50645192 rdar://51200372 rdar://51767702 Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D63586 llvm-svn: 364105
* clang-format a block; NFCGeorge Burgess IV2019-06-211-6/+7
| | | | | | | The indentation of the return here was off, and confusing as a result. Cleaned up a bit extra while I was in the area. llvm-svn: 364104
* PR42301: Abort cleanly if we encounter a huge source file rather thanRichard Smith2019-06-212-0/+27
| | | | | | | | | | crashing. Ideally we wouldn't care about the size of a file so long as it fits in memory, but in practice we have lots of hardocded assumptions that unsigned can be used to index files, string literals, and so on. llvm-svn: 364103
* Fix __has_cpp_attribute expansion to produce trailing L and (whereRichard Smith2019-06-212-87/+77
| | | | | | | | necessary) leading whitespace. Simplify unit test and extend to cover no_unique_address attribute. llvm-svn: 364102
* [X86] Add test cases for incorrect shrinking of volatile vector loads from ↵Craig Topper2019-06-211-0/+34
| | | | | | | | | 128-bits to 32 or 64 bits. NFC This is caused by isel patterns that look for vzmovl+load and treat it the same as vzload. llvm-svn: 364101
* Devirtualize destructor of final class.Hiroshi Yamauchi2019-06-212-3/+50
| | | | | | | | | | | | | | | | | | | Summary: Take advantage of the final keyword to devirtualize destructor calls. Fix https://bugs.llvm.org/show_bug.cgi?id=21368 Reviewers: rsmith Reviewed By: rsmith Subscribers: davidxl, Prazek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63161 llvm-svn: 364100
* AMDGPU: Fix not using s33 for scratch wave offset in kernelsMatt Arsenault2019-06-214-16/+22
| | | | | | Fixes missing piece from r363990. llvm-svn: 364099
* [Target] Decouple ObjCLanguageRuntime from LanguageRuntimeAlex Langford2019-06-2116-65/+135
| | | | | | | | | | | | Summary: ObjCLanguageRuntime was being pulled into LanguageRuntime because of Breakpoint Preconditions. If we move BreakpointPrecondition out of Breakpoint, we can extend the LanguageRuntime plugin interface so that LanguageRuntimes can give us a BreakpointPrecondition for exceptions. Differential Revision: https://reviews.llvm.org/D63181 llvm-svn: 364098
* [X86] Add DAG combine to turn (vzmovl (insert_subvector undef, X, 0)) into ↵Craig Topper2019-06-216-70/+25
| | | | | | | | | | | | | | | | (insert_subvector allzeros, (vzmovl X), 0) 128/256 bit scalar_to_vectors are canonicalized to (insert_subvector undef, (scalar_to_vector), 0). We have isel patterns that try to match this pattern being used by a vzmovl to use a 128-bit instruction and a subreg_to_reg. This patch detects the insert_subvector undef portion of this and pulls it through the vzmovl, creating a narrower vzmovl and an insert_subvector allzeroes. We can then match the insertsubvector into a subreg_to_reg operation by itself. Then we can fall back on existing (vzmovl (scalar_to_vector)) patterns. Note, while the scalar_to_vector case is the motivating case I didn't restrict to just that case. I'm also wondering about shrinking any 256/512 vzmovl to an extract_subvector+vzmovl+insert_subvector(allzeros) but I fear that would have bad implications to shuffle combining. I also think there is more canonicalization we can do with vzmovl with loads or scalar_to_vector with loads to create vzload. Differential Revision: https://reviews.llvm.org/D63512 llvm-svn: 364095
* Implement P0340R3: Make 'underlying_type' SFINAE-friendly. Reviewed as ↵Marshall Clow2019-06-213-21/+115
| | | | | | https://reviews.llvm.org/D63574 llvm-svn: 364094
* [X86] Don't mark v64i8/v32i16 ISD::SELECT as custom unless they are legal types.Craig Topper2019-06-212-7/+108
| | | | | | | | | We don't have any Custom handling during type legalization. Only operation legalization. Fixes PR42355 llvm-svn: 364093
* [X86] Add avx512bw command lines to avx512-select.llCraig Topper2019-06-211-89/+192
| | | | | | | Prep for fixing PR42355 and ensuring we have coverage of ISD::SELECT for v64i8/v32i16 on KNL and SKX configs. llvm-svn: 364092
* [X86] Add a debug print of the node in the default case for unhandled ↵Craig Topper2019-06-211-0/+4
| | | | | | | | | | opcodes in ReplaceNodeResults. This should be unreachable, but bugs can make it reachable. This adds a debug print so we can see the bad node in the output when the llvm_unreachable triggers. llvm-svn: 364091
* [X86][AVX] Combine INSERT_SUBVECTOR(SRC0, EXTRACT_SUBVECTOR(SRC1)) as shuffleSimon Pilgrim2019-06-216-86/+148
| | | | | | Subvector shuffling often ends up as insert/extract subvector. llvm-svn: 364090
* Revert [test][Driver] Fix Clang :: Driver/cl-response-file.cReid Kleckner2019-06-211-1/+1
| | | | | | | | | This reverts r363985 (git commit d5f16d6cfccc4b0b13b6c01d16c673886d53e695) This test can't use printf on Windows because the path contains backslashes which must not be interpreted as escapes by printf. llvm-svn: 364089
* [clang-scan-deps] print the dependencies to stdoutAlex Lorenz2019-06-215-21/+88
| | | | | | | | and remove the need to use -MD options in the CDB Differential Revision: https://reviews.llvm.org/D63579 llvm-svn: 364088
* Quote path to Python executable in case it has spacesReid Kleckner2019-06-211-3/+13
| | | | | | | | | These days Python 3 is typically installed into C:/Program Files, so cope with that. Similar to r364077 in compiler-rt. llvm-svn: 364087
* [AArch64][GlobalISel] Implement selection support for the new G_JUMP_TABLE ↵Amara Emerson2019-06-214-1/+178
| | | | | | | | | | and G_BRJT ops. With this we can now fully code generate jump tables, which is important for code size. Differential Revision: https://reviews.llvm.org/D63223 llvm-svn: 364086
* [GlobalISel][IRTranslator] Change switch table translation to generate jump ↵Amara Emerson2019-06-216-181/+816
| | | | | | | | | | | | | | | | | | | | | | | | | | tables and range checks. This change makes use of the newly refactored SwitchLoweringUtils code from SelectionDAG to in order to generate jump tables and range checks where appropriate. Much of this code is ported from SDAG with some modifications. We generate G_JUMP_TABLE and G_BRJT instructions when JT opportunities are found. This means that targets which previously relied on the naive one MBB per case stmt translation will now start falling back until they add support for the new opcodes. For range checks, we don't generate any previously unused operations. This just recognizes contiguous ranges of case values and generates a single block per range. Single case value blocks are just a special case of ranges so we get that support almost for free. There are still some optimizations missing that I haven't ported over, and bit-tests are also unimplemented. This patch series is already complex enough. Actual arm64 support for selection of jump tables is coming in a later patch. Differential Revision: https://reviews.llvm.org/D63169 llvm-svn: 364085
* [SLP] Look-ahead operand reordering heuristic.Simon Pilgrim2019-06-212-93/+276
| | | | | | | | | | This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example). Committed on behalf of @vporpo (Vasileios Porpodas) Differential Revision: https://reviews.llvm.org/D60897 llvm-svn: 364084
OpenPOWER on IntegriCloud