summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Breakpad: Add support for parsing STACK WIN recordsPavel Labath2019-08-263-4/+151
| | | | | | | | | | | | Summary: The fields that aren't useful for us right now are simply ignored. Reviewers: amccarth, markmentovai Subscribers: rnk, lldb-commits Differential Revision: https://reviews.llvm.org/D66633 llvm-svn: 369892
* [GWP_ASAN] Avoid using VERSION_GREATER_EQUAL in cmake filesBjorn Pettersson2019-08-261-1/+1
| | | | | | | | | | | This is a fixup for r369823 which introduced the use of VERSION_GREATER_EQUAL in the cmake config for gwp_asan. Minimum supported version of cmake in LLVM is 3.4.3 and VERSION_GREATER_EQUAL was not introduced until later versions of cmake. llvm-svn: 369891
* [ELF] EhFrameSection: postpone FDE liveness check to finalizeSectionsFangrui Song2019-08-264-32/+50
| | | | | | | | | | | | | | | EhFrameSection::addSection checks liveness of FDE early. This makes it infeasible to move combineEhSections() before ICF. Postpone the check to EhFrameSection::finalizeContents(). This is what ARMExidxSyntheticSection does and it will make a subsequent patch D66717 simpler. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D66727 llvm-svn: 369890
* [ELF] Make LinkerScript::assignAddresses iterativeFangrui Song2019-08-267-17/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR42990. For `SECTIONS { b = a; . = 0xff00 + (a >> 8); a = .; }`, we currently set st_value(a)=0xff00 while st_value(b)=0xffff. The following call tree demonstrates the problem: ``` link<ELF64LE>(Args); Script->declareSymbols(); // insert a and b as absolute Defined Writer<ELFT>().run(); Script->processSectionCommands(); addSymbol(cmd); // a and b are re-inserted. LinkerScript::getSymbolValue // is lazily called by subsequent evaluation finalizeSections(); forEachRelSec(scanRelocations<ELFT>); processRelocAux // another problem PR42506, not affected by this patch finalizeAddressDependentContent(); // loop executed once script->assignAddresses(); // a = 0, b = 0xff00 script->assignAddresses(); // a = 0xff00, _end = 0xffff ``` We need another assignAddresses() to finalize the value of `a`. This patch 1) modifies assignAddress() to track the original section/value of each symbol and return a symbol whose section/value has changed. 2) moves the post-finalizeSections assignAddress() inside the loop of finalizeAddressDependentContent() and makes it iterative. Symbol assignment may not converge so we make a few attempts before bailing out. Note, assignAddresses() must be called at least twice. The penultimate call finalized section addresses while the last finalized symbol values. It is somewhat obscure and there was no comment. linkerscript/addr-zero.test tests this. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D66279 llvm-svn: 369889
* [NFC][cmake] Build fix in tools/llvm-config/CMakeLists.txtGabor Buella2019-08-261-3/+3
| | | | | | | | | | | | | | | To avoid the following error message (using cmake version 3.13.4) : ``` CMake Error at tools/llvm-config/CMakeLists.txt:37 (string): Syntax error in cmake code when parsing string-std=[^ ]\+Invalid escape sequence \+ ``` Reviewed By: mgorny Differential Revision: https://reviews.llvm.org/D58619 llvm-svn: 369887
* [LoopUnroll] Handle certain PHIs in full unrolling properlyBjorn Pettersson2019-08-262-3/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When reconstructing the CFG of the loop after unrolling, LoopUnroll could in some cases remove the phi operands of loop-carried values instead of preserving them, resulting in undef phi values after loop unrolling. When doing this reconstruction, avoid removing incoming phi values for phis in the successor blocks if the successor is the block we are jumping to anyway. Patch-by: ebevhan Reviewers: fhahn, efriedma Reviewed By: fhahn Subscribers: bjope, lebedev.ri, zzheng, dmgreen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66334 llvm-svn: 369886
* [lldb] Construct the dummy target when the first Debugger object is constructedRaphael Isemann2019-08-262-5/+5
| | | | | | | | | | | | | | | | | | | | | Summary: We should always have a dummy target, so we might as well construct it directly when we create a Debugger object. The idea is that if this patch doesn't cause any problems that we can get rid of all the logic that handles situations where we don't have a dummy target (as all that code is currently untested as there seems to be no way to have no dummy target in LLDB). Reviewers: labath, jingham Reviewed By: labath, jingham Subscribers: jingham, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66581 llvm-svn: 369885
* [clangd] Send highlighting diff beyond the end of the file.Haojian Wu2019-08-268-45/+57
| | | | | | | | | | | | | | Summary: This would make the client life (tracking the changes) easier. Reviewers: jvikstrom Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66541 llvm-svn: 369884
* [lldb][NFC] Add ProcessInfo::GetNameAsStringRef to simplify some codeRaphael Isemann2019-08-264-15/+7
| | | | llvm-svn: 369880
* [ELF] Error if --strip-all and --emit-relocs are used togetherFangrui Song2019-08-262-0/+6
| | | | | | | | | | | | | | | | | | | | | | | --strip-all suppresses the creation of in.symtab This can cause a null pointer dereference in OutputSection::finalize() // --emit-relocs => copyRelocs is true if (!config->copyRelocs || (type != SHT_RELA && type != SHT_REL)) return; ... link = in.symTab->getParent()->sectionIndex; // in.symTab is null Let's just disallow the combination. In some cases the combination can cause GNU linkers to fail: * ld.bfd: final link failed: invalid operation * gold: internal error in set_no_output_symtab_entry, at ../../gold/object.h:1814 Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D66704 llvm-svn: 369878
* [NFC][Regalloc] Add testcases for D66576Zi Xuan Wu2019-08-264-0/+854
| | | | llvm-svn: 369877
* [X86] Automatically generate stack folding tests. NFCAmaury Sechet2019-08-2522-3750/+19916
| | | | llvm-svn: 369876
* [Hexagon] remove noise from tests; NFCSanjay Patel2019-08-251-15/+10
| | | | llvm-svn: 369875
* [Hexagon][x86] add tests for bit-test; NFCSanjay Patel2019-08-252-1/+114
| | | | | | | More coverage for D66687 (assuming we make this a generic combine with TLI hook). llvm-svn: 369874
* [Wdocumentation] improve wording of a warning messageDmitri Gribenko2019-08-252-7/+7
| | | | | | | | | | | Based on @davezarzycki remarks in D64696 improved the wording of the warning message. Differential Revision: https://reviews.llvm.org/D66700 Patch by Mark de Wever. llvm-svn: 369873
* [X86][DAGCombiner] Teach narrowShuffle to use concat_vectors instead of ↵Craig Topper2019-08-252-2/+41
| | | | | | | | | | | | | | | | | | | | | inserting into undef Summary: Concat_vectors is more canonical during early DAG combine. For example, its what's used by SelectionDAGBuilder when converting IR shuffles into SelectionDAG shuffles when element counts between inputs and mask don't match. We also have combines in DAGCombiner than can pull concat_vectors through a shuffle. See partitionShuffleOfConcats. So it seems like concat_vectors is a better operation to use here. I had to teach DAGCombiner's SimplifyVBinOp to also handle concat_vectors with undef. I haven't checked yet if we can remove the INSERT_SUBVECTOR version in there or not. I didn't want to mess with the other caller of getShuffleHalfVectors that's used during shuffle lowering where insert_subvector probably is what we want to produce so I've enabled this via a boolean passed to the function. Reviewers: spatel, RKSimon Reviewed By: RKSimon Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66504 llvm-svn: 369872
* [X86] Add test case for inserting/extracting from two shuffled vectors. NFCAmaury Sechet2019-08-251-0/+82
| | | | llvm-svn: 369871
* [X86] Add test case for inserting/extracting from shuffled vectors. NFCAmaury Sechet2019-08-251-0/+80
| | | | llvm-svn: 369870
* [PowerPC][AIX] Adds support for writing the .data section in assembly filesXing Xue2019-08-2510-13/+130
| | | | | | | | | | | | | | | | | Summary: Adds support for generating the .data section in assembly files for global variables with a non-zero initialization. The support for writing the .data section in XCOFF object files will be added in a follow-on patch. Any relocations are not included in this patch. Reviewers: hubert.reinterpretcast, sfertile, jasonliu, daltenty, Xiangling_L Reviewed by: hubert.reinterpretcast Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, wuzish, shchenz, DiggerLin, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66154 llvm-svn: 369869
* [ELF] Delete a redundant dyn_cast<InputSection>. NFCFangrui Song2019-08-251-6/+5
| | | | llvm-svn: 369868
* [AMDGPU] Downgrade from StringLiteral to const char* in an attempt to make ↵Benjamin Kramer2019-08-251-3/+3
| | | | | | GCC 5 happy llvm-svn: 369867
* Fixup in test/DebugInfo/X86/live-debug-vars-discard-invalid.mirBjorn Pettersson2019-08-251-7/+7
| | | | | | | | | | | | The test case used invalid source operands as input to BTS64rr instructions (feeding register operands with immediates). This patch changes those instruction into using BTS64ri8 instead, which seems to better match the operand types. Fixes problems seen in https://reviews.llvm.org/D63973. llvm-svn: 369866
* [TableGen] Correct comments for end of namespace. NFCBjorn Pettersson2019-08-2510-29/+29
| | | | | | | | | | | | | | | | | | | | | | Summary: Update end-of-namespace comments generated by tablegen emitters to fulfill the rules setup by clang-tidy's llvm-namespace-comment checker. Fixed a few end-of-namespace comments in the tablegen source code as well. Reviewers: craig.topper Reviewed By: craig.topper Subscribers: craig.topper, stoklund, dschuff, sbc100, jgravelle-google, aheejin, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66396 llvm-svn: 369865
* [SDAG] Fold umul_lohi with 0 or 1 multiplicandNikita Popov2019-08-259-7745/+4999
| | | | | | | | | | These can turn up during multiplication legalization. In principle these should also apply to smul_lohi, but I wasn't able to figure out how to produce those with the necessary operands. Differential Revision: https://reviews.llvm.org/D66380 llvm-svn: 369864
* [X86] Teach -Os immediate sharing code to not count constant uses that will ↵Craig Topper2019-08-252-22/+21
| | | | | | | | | | | become INC/DEC. INC/DEC don't use an immediate so we don't need to count it. We also shouldn't use the custom isel for it. Fixes PR42998. llvm-svn: 369863
* [X86] Add test cases for PR42998. NFCCraig Topper2019-08-251-0/+73
| | | | llvm-svn: 369862
* FileManager: Factor duplicated code in getBufferForFile, NFCDuncan P. N. Exon Smith2019-08-252-12/+14
| | | | | | | Incidentally, this also unifies the two versions (removing an unnecessary call to `SmallString::c_str`). llvm-svn: 369861
* Removing block comments from CodeView records in assembly files & related ↵Nilanjana Basu2019-08-2511-757/+70
| | | | | | code cleanup llvm-svn: 369860
* [X86] Add isel patterns to match vpdpwssd avx512vnni instruction from ↵Craig Topper2019-08-242-0/+227
| | | | | | add+pmaddwd nodes. llvm-svn: 369859
* AMDGPU: Add baseline test for mul24 ordering issuesMatt Arsenault2019-08-241-0/+263
| | | | llvm-svn: 369858
* AMDGPU: Preserve value name when inserting mul24 intrinsicMatt Arsenault2019-08-241-1/+3
| | | | llvm-svn: 369857
* AMDGPU: Introduce a flag to disable mul24 intrinsic formationMatt Arsenault2019-08-242-55/+172
| | | | llvm-svn: 369856
* AMDGPU: Generate check linesMatt Arsenault2019-08-241-106/+345
| | | | | | | | Checking all the instructions will help catch LICM changes when passes are reordered. Also switch to using gfx9 since global stores make the relevant instructions more obvious. llvm-svn: 369855
* [TLI] Simplify code. NFCI.Benjamin Kramer2019-08-241-9/+4
| | | | llvm-svn: 369854
* [clang-tidy] Manually enable exceptions in tesst that uses themBenjamin Kramer2019-08-241-1/+1
| | | | llvm-svn: 369853
* Hack around a GCC ICE that was fixed in GCC 6.2Benjamin Kramer2019-08-241-3/+9
| | | | | | | | | | | lib/Target/X86/AsmParser/X86AsmParser.cpp: In member function ‘void {anonymous}::X86AsmParser::SwitchMode(unsigned int)’: lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76: in constexpr expansion of ‘AllModes.llvm::FeatureBitset::FeatureBitset(std::initializer_list<unsigned int>{((const unsigned int*)(& ._157)), 3u})’ include/llvm/MC/SubtargetFeature.h:56:12: in constexpr expansion of ‘llvm::FeatureBitset::set(I)’ lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76: internal compiler error: in fold_binary_loc, at fold-const.c:9921 FeatureBitset AllModes({X86::Mode64Bit, X86::Mode32Bit, X86::Mode16Bit}); ^ llvm-svn: 369852
* Try to make MSVC 2017 happy.Benjamin Kramer2019-08-241-1/+1
| | | | | | | | AArch64BaseInfo.h(316): error C3615: constexpr function 'llvm::SysAlias::SysAlias' cannot result in a constant expression AArch64BaseInfo.h(316): note: failure was caused by call of undefined function or one not declared 'constexpr' AArch64BaseInfo.h(316): note: see usage of 'llvm::FeatureBitset::FeatureBitset' llvm-svn: 369851
* Fix some accidental global initializers by using StringLiteral instead of ↵Benjamin Kramer2019-08-243-6/+7
| | | | | | StringRef llvm-svn: 369850
* Update tablegen test after r369847.Benjamin Kramer2019-08-242-2/+2
| | | | llvm-svn: 369849
* [llvm-reduce] Silence -WdocumentationBenjamin Kramer2019-08-241-1/+0
| | | | | | ReduceGlobalVars.cpp:17:6: warning: '@returns' command used in a comment that is attached to a function returning void llvm-svn: 369848
* Use a bit of relaxed constexpr to make FeatureBitset costant intializableBenjamin Kramer2019-08-249-43/+129
| | | | | | | | | | | This requires std::intializer_list to be a literal type, which it is starting with C++14. The downside is that std::bitset is still not constexpr-friendly so this change contains a re-implementation of most of it. Shrinks clang by ~60k. llvm-svn: 369847
* [OpenCL] Microoptimize OCL2Qual a bitBenjamin Kramer2019-08-242-20/+21
| | | | | | Still not optimal, but makes clang 25k smaller. llvm-svn: 369846
* [analyzer] Analysis: Fix checker silencingCsaba Dabis2019-08-242-29/+35
| | | | llvm-svn: 369845
* [ELF] Simplify with less_second. NFCFangrui Song2019-08-241-4/+1
| | | | llvm-svn: 369844
* [Testing] Unbreak r369830David Zarzycki2019-08-241-0/+1
| | | | llvm-svn: 369843
* [Constant] Add 'isElementWiseEqual()' methodRoman Lebedev2019-08-243-16/+23
| | | | | | | | | | | Promoting it from InstCombine's tryToReuseConstantFromSelectInComparison(). Return true if this constant and a constant 'Y' are element-wise equal. This is identical to just comparing the pointers, with the exception that for vectors, if only one of the constants has an `undef` element in some lane, the constants still match. llvm-svn: 369842
* [InstCombine] matchThreeWayIntCompare(): commutativity awarenessRoman Lebedev2019-08-242-65/+66
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: `matchThreeWayIntCompare()` looks for ``` select i1 (a == b), i32 Equal, i32 (select i1 (a < b), i32 Less, i32 Greater) ``` but both of these selects/compares can be in it's commuted form, so out of 8 variants, only the two most basic ones is handled. This fixes regression being introduced in D66232. Reviewers: spatel, nikic, efriedma, xbolva00 Reviewed By: spatel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66607 llvm-svn: 369841
* [InstCombine] Try to reuse constant from select in leading comparisonRoman Lebedev2019-08-246-89/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If we have e.g.: ``` %t = icmp ult i32 %x, 65536 %r = select i1 %t, i32 %y, i32 65535 ``` the constants `65535` and `65536` are suspiciously close. We could perform a transformation to deduplicate them: ``` Name: ult %t = icmp ult i32 %x, 65536 %r = select i1 %t, i32 %y, i32 65535 => %t.inv = icmp ugt i32 %x, 65535 %r = select i1 %t.inv, i32 65535, i32 %y ``` https://rise4fun.com/Alive/avb While this may seem esoteric, this should certainly be good for vectors (less constant pool usage) and for opt-for-size - need to have only one constant. But the real fun part here is that it allows further transformation, in particular it finishes cleaning up the `clamp` folding, see e.g. `canonicalize-clamp-with-select-of-constant-threshold-pattern.ll`. We start with e.g. ``` %dont_need_to_clamp_positive = icmp sle i32 %X, 32767 %dont_need_to_clamp_negative = icmp sge i32 %X, -32768 %clamp_limit = select i1 %dont_need_to_clamp_positive, i32 -32768, i32 32767 %dont_need_to_clamp = and i1 %dont_need_to_clamp_positive, %dont_need_to_clamp_negative %R = select i1 %dont_need_to_clamp, i32 %X, i32 %clamp_limit ``` without this patch we currently produce ``` %1 = icmp slt i32 %X, 32768 %2 = icmp sgt i32 %X, -32768 %3 = select i1 %2, i32 %X, i32 -32768 %R = select i1 %1, i32 %3, i32 32767 ``` which isn't really a `clamp` - both comparisons are performed on the original value, this patch changes it into ``` %1.inv = icmp sgt i32 %X, 32767 %2 = icmp sgt i32 %X, -32768 %3 = select i1 %2, i32 %X, i32 -32768 %R = select i1 %1.inv, i32 32767, i32 %3 ``` and then the magic happens! Some further transform finishes polishing it and we finally get: ``` %t1 = icmp sgt i32 %X, -32768 %t2 = select i1 %t1, i32 %X, i32 -32768 %t3 = icmp slt i32 %t2, 32767 %R = select i1 %t3, i32 %t2, i32 32767 ``` which is beautiful and just what we want. Proofs for `getFlippedStrictnessPredicateAndConstant()` for de-canonicalization: https://rise4fun.com/Alive/THl Proofs for the fold itself: https://rise4fun.com/Alive/THl Reviewers: spatel, dmgreen, nikic, xbolva00 Reviewed By: spatel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66232 llvm-svn: 369840
* [InstCombine][NFC] reuse-constant-from-select-in-icmp.ll - revisit testsRoman Lebedev2019-08-241-3/+13
| | | | llvm-svn: 369839
* [ELF] Make member function Writer<ELFT>::removeEmptyPTLoad non-member. NFCFangrui Song2019-08-241-3/+1
| | | | llvm-svn: 369838
OpenPOWER on IntegriCloud