summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [ORC][JITLink] Name in-memory compiled objects after their source modules.Lang Hames2019-04-301-1/+2
| | | | | | | | In-memory compiled object buffer identifiers will now be derived from the identifiers of their source IR modules. This makes it easier to connect in-memory objects with their source modules in debugging output. llvm-svn: 359613
* [llvm-profdata] Add overlap command to compute similarity b/w two profile filesRong Xu2019-04-303-0/+283
| | | | | | | | | Add overlap functionality to llvm-profdata tool to compute the similarity between two profile files. Differential Revision: https://reviews.llvm.org/D60977 llvm-svn: 359612
* [NFC][InlineCost] cleanup - comments, overflow handling.Fedor Sergeev2019-04-301-52/+61
| | | | | | | | Reviewed By: apilipenko Tags: #llvm Differential Revision: https://reviews.llvm.org/D60751 llvm-svn: 359609
* [X86][SSE] Fold extract_subvector(extend(x)) -> extend_vector_inreg(x)Simon Pilgrim2019-04-301-5/+7
| | | | | | | | This adds any extend support - folding to zero_extend_vector_inreg (PMOVZX) for legality Minor improvement for PR39709 llvm-svn: 359608
* Fix stack-use-after free after r359580Nico Weber2019-04-301-3/+4
| | | | | | | | `Candidate` was a StringRef refering to a temporary string. Instead, create a local variable for the string and use a StringRef referring to that. llvm-svn: 359604
* [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobjDan Gohman2019-04-301-0/+1
| | | | | | | | | Teach llvm-readobj about WASM_SYMBOL_EXPLICIT_NAME. Differential Revision: https://reviews.llvm.org/D61323 Reviewer: sbc100 llvm-svn: 359602
* [WebAssembly] Support f16 libcallsDan Gohman2019-04-302-1/+23
| | | | | | | | | | | | Add support for f16 libcalls in WebAssembly. This entails adding signatures for the remaining F16 libcalls, and renaming gnu_f2h_ieee/gnu_h2f_ieee to truncsfhf2/extendhfsf2 for consistency between f32 and f64/f128 (compiler-rt already supports this). Differential Revision: https://reviews.llvm.org/D61287 Reviewer: dschuff llvm-svn: 359600
* [X86] Remove if that's always trueCraig Topper2019-04-301-2/+1
| | | | | | | | It's been like this since it was added in a refactor of this code. Fixes PR41659 llvm-svn: 359597
* [SimplifyLibCalls] Clean up code (NFC)Evandro Menezes2019-04-301-6/+8
| | | | | | Fix pointer check after dereferencing (PR41665). llvm-svn: 359595
* [X86] If PreprocessISelDAG reorders a load before a call, make sure we ↵Craig Topper2019-04-301-0/+5
| | | | | | | | | | | | remove dead nodes from the graph The reordering can leave at least a dead TokenFactor in the graph. This cause the linearize scheduler to fail with something like the assert seen in PR22614. This is only one of many ways we can break the linearize scheduler today so I can't say for sure that any of the other failures in that bug were caused by this issue. This takes the heavy hammer approach of just running RemoveDeadNodes unconditionally at the end of the PreprocessISelDAG. If this turns out to be a compile time hit, we can try to refine it. Differential Revision: https://reviews.llvm.org/D61164 llvm-svn: 359582
* [X86] Initial cleanups on the FixupLEAs pass. Separate Atom LEA creation ↵Craig Topper2019-04-301-91/+75
| | | | | | | | | | | | | | | | | | | | | | from other LEA optimizations. This removes some of the class variables. Merge basic block processing into runOnMachineFunction to keep the flags local. Pass MachineBasicBlock around instead of an iterator. We can get the iterator in the few places that need it. Allows a range-based outer for loop. Separate the Atom optimization from the rest of the optimizations. This allows fixupIncDec to create INC/DEC and still allow Atom to turn it back into LEA when profitable by its heuristics. I'd like to improve fixupIncDec to turn LEAs into ADD any time the base or index register is equal to the destination register. This is profitable regardless of the various slow flags. But again we would want Atom to be able to undo that. Differential Revision: https://reviews.llvm.org/D60993 llvm-svn: 359581
* Re-reland "[Option] Fix PR37006 prefix choice in findNearest"Nico Weber2019-04-301-24/+24
| | | | | | | | | | | | | | | | This was first reviewed in https://reviews.llvm.org/D46776 and landed in r332299, but got reverted because it broke the PS4 bots. https://reviews.llvm.org/D50410 fixed this, and then this change was re-reviewed at https://reviews.llvm.org/D50515 and relanded in r341329. It got reverted due to causing MSan issues. However, nobody wrote down the error message and the bot link is dead, so I'm relanding this to capture the MSan error. I'll then either fix it, or copy it somewhere and revert if fixing looks difficult. llvm-svn: 359580
* [SelectionDAG] remove div-by-zero constant folding restrictionSanjay Patel2019-04-301-7/+3
| | | | | | | | | | | | | | | | We don't have this restriction in IR, so it should not be here either simply out of consistency. Code that wants to handle FP exceptions is expected to use the 'strict' variants of these nodes. We don't get the frem case because frem by 0.0 produces NaN (invalid), and that's the remaining check here (so the removed check for frem was dead code AFAIK). This is the only place in SDAG that uses "HasFPExceptions", so I think we should remove that entirely as a follow-up patch. llvm-svn: 359566
* [TableGen] Fix null pointer dereferencing in token parser.Simon Pilgrim2019-04-301-8/+10
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359559
* Revert rL359519 : [MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.Simon Pilgrim2019-04-301-9/+0
| | | | | | | | | | | | | | | | | | Summary: MemorySSA keeps internal pointers of AA and DT. If these get invalidated, so should MemorySSA. Reviewers: george.burgess.iv, chandlerc Subscribers: jlebar, Prazek, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61043 ........ This was causing windows build bot failures llvm-svn: 359555
* [ARM] Implement TTI::getMemcpyCostSjoerd Meijer2019-04-303-0/+43
| | | | | | | | | This implements TargetTransformInfo method getMemcpyCost, which estimates the number of instructions to which a memcpy instruction expands to. Differential Revision: https://reviews.llvm.org/D59787 llvm-svn: 359547
* Fix for bug 41512: lower INSERT_VECTOR_ELT(ZeroVec, 0, Elt) to ↵Simon Pilgrim2019-04-301-0/+8
| | | | | | | | | | | | | | | | | SCALAR_TO_VECTOR(Elt) for all SSE flavors Current LLVM uses pxor+pinsrb on SSE4+ for INSERT_VECTOR_ELT(ZeroVec, 0, Elt) insead of much simpler movd. INSERT_VECTOR_ELT(ZeroVec, 0, Elt) is idiomatic construct which is used e.g. for _mm_cvtsi32_si128(Elt) and for lowest element initialization in _mm_set_epi32. So such inefficient lowering leads to significant performance digradations in ceratin cases switching from SSSE3 to SSE4. https://bugs.llvm.org/show_bug.cgi?id=41512 Here INSERT_VECTOR_ELT(ZeroVec, 0, Elt) is simply converted to SCALAR_TO_VECTOR(Elt) when applicable since latter is closer match to desired behavior and always efficiently lowered to movd and alike. Committed on behalf of @Serge_Preis (Serge Preis) Differential Revision: https://reviews.llvm.org/D60852 llvm-svn: 359545
* [TargetLowering] findOptimalMemOpLowering. NFCI.Sjoerd Meijer2019-04-302-123/+119
| | | | | | | | | | This was a local static funtion in SelectionDAG, which I've promoted to TargetLowering so that I can reuse it to estimate the cost of a memory operation in D59787. Differential Revision: https://reviews.llvm.org/D59766 llvm-svn: 359543
* [ARM GlobalISel] Widen small shift operandsDiana Picus2019-04-301-0/+1
| | | | | | | The legalizer was already widening the shift amount. Add tests for that behaviour, and also support widening the shifted value. llvm-svn: 359542
* [AsmPrinter] Make AsmPrinter::HandlerInfo::Handler a unique_ptrFangrui Song2019-04-302-16/+15
| | | | | | | Handlers.clear() in AsmPrinter::doFinalization() will destroy these handlers. A unique_ptr makes the ownership clearer. llvm-svn: 359541
* [ARM GlobalISel] Be more careful about bailing outDiana Picus2019-04-301-2/+2
| | | | | | | | | Bail out on function arguments/returns with types aggregating an unsupported type. This fixes cases where we would happily and incorrectly lower functions taking e.g. [1 x i64] parameters, when we don't even support plain i64 yet. llvm-svn: 359540
* [TargetLowering] Change getOptimalMemOpType to take a function attribute listSjoerd Meijer2019-04-3016-49/+40
| | | | | | | | | | | | The MachineFunction wasn't used in getOptimalMemOpType, but more importantly, this allows reuse of findOptimalMemOpLowering that is calling getOptimalMemOpType. This is the groundwork for the changes in D59766 and D59787, that allows implementation of TTI::getMemcpyCost. Differential Revision: https://reviews.llvm.org/D59785 llvm-svn: 359537
* MSan: handle llvm.lifetime.start intrinsicAlexander Potapenko2019-04-301-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When a variable goes into scope several times within a single function or when two variables from different scopes share a stack slot it may be incorrect to poison such scoped locals at the beginning of the function. In the former case it may lead to false negatives (see https://github.com/google/sanitizers/issues/590), in the latter - to incorrect reports (because only one origin remains on the stack). If Clang emits lifetime intrinsics for such scoped variables we insert code poisoning them after each call to llvm.lifetime.start(). If for a certain intrinsic we fail to find a corresponding alloca, we fall back to poisoning allocas for the whole function, as it's now impossible to tell which alloca was missed. The new instrumentation may slow down hot loops containing local variables with lifetime intrinsics, so we allow disabling it with -mllvm -msan-handle-lifetime-intrinsics=false. Reviewers: eugenis, pcc Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60617 llvm-svn: 359536
* [DebugInfo] DW_OP_deref_size in PrologEpilogInserter.Markus Lavin2019-04-307-3/+53
| | | | | | | | | | | | | | | | | | | | The PrologEpilogInserter need to insert a DW_OP_deref_size before prepending a memory location expression to an already implicit expression to avoid having the existing expression act on the memory address instead of the value behind it. The reason for using DW_OP_deref_size and not plain DW_OP_deref is that big-endian targets need to read the right size as simply truncating a larger read would yield the wrong result (LSB bytes are not at the lower address). This re-commit fixes issues reported in the first one. Namely deref was inserted under wrong conditions and additionally the deref_size argument was incorrectly encoded. Differential Revision: https://reviews.llvm.org/D59687 llvm-svn: 359535
* [DAGCombiner] Do not generate ISD::ADDE node if adde is not legal for the ↵Zi Xuan Wu2019-04-301-1/+3
| | | | | | | | | | | | | | | target when combine ISD::TRUNC node Do not combine (trunc adde(X, Y, Carry)) into (adde trunc(X), trunc(Y), Carry), if adde is not legal for the target. Even it's at type-legalize phase. Because adde is special and will not be legalized at operation-legalize phase later. This fixes: PR40922 https://bugs.llvm.org/show_bug.cgi?id=40922 Differential Revision: https://reviews.llvm.org//D60854 llvm-svn: 359532
* [ORC] Allow JITDylib definition generators to return Errors.Lang Hames2019-04-302-58/+94
| | | | | | | | | | | | | | | | | | | | Background: A definition generator can be attached to a JITDylib to generate new definitions in response to queries. For example: a generator that forwards calls to dlsym can map symbols from a dynamic library into the JIT process on demand. If definition generation fails then the generator should be able to return an error. This allows the JIT API to distinguish between the case where a generator does not provide a definition, and the case where it was not able to determine whether it provided a definition due to an error. The immediate motivation for this is cross-process symbol lookups: If the remote-lookup generator is attached to a JITDylib early in the search list, and if a generator failure is misinterpreted as "no definition in this JITDylib" then lookup may continue and bind to a different definition in a later JITDylib, which is a bug. llvm-svn: 359521
* [MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.Alina Sbirlea2019-04-291-0/+9
| | | | | | | | | | | | | | | | Summary: MemorySSA keeps internal pointers of AA and DT. If these get invalidated, so should MemorySSA. Reviewers: george.burgess.iv, chandlerc Subscribers: jlebar, Prazek, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61043 llvm-svn: 359519
* [PDB] Fix hash function used to write /src/headerblockNico Weber2019-04-292-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | lld-link used to write PDB files that DIA couldn't recover natvis files from if: - The global strings table was > 64kiB - There were at least 3 natvis files The cause was that the hash function for the /src/headerblock stream was incorrect: It needs to be truncated to 16 bit. If the global strings table was <= 64kiB, truncating to 16 bit is a no-op, so this wasn't needed for small programs. If there are only 1 or 2 natvis files, then the growth strategy in HashTable::grow() would mean the hash table would have 2 buckets (for 1 natvis file) or 4 buckets (for 4 natvis files), and since the hash function is used modulo number of buckets, and since 2 and 4 divide 0x10000, the missing `% 0x10000` is a no-op there too. For 3 natvis files, the hash table grows to 6 buckets, which has a factor that's not common with 0x10000 and the difference starts to matter. Fixes PR41626. Differential Revision: https://reviews.llvm.org/D61277 llvm-svn: 359515
* [ORC] Replace the LLJIT/LLLazyJIT Create methods with Builder utilities.Lang Hames2019-04-291-105/+131
| | | | | | | | | | | LLJITBuilder and LLLazyJITBuilder construct LLJIT and LLLazyJIT instances respectively. Over time these will allow more configurable options to be added while remaining easy to use in the default case, which for default in-process JITing is now: auto J = ExitOnErr(LLJITBuilder.create()); llvm-svn: 359511
* [WebAssembly] Make an assertion message prettier. NFC.Dan Gohman2019-04-291-2/+2
| | | | | | This is a follow-up to https://reviews.llvm.org/D59521. llvm-svn: 359509
* [ThinLTO] Adding architecture name into saved object filenameSteven Wu2019-04-291-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For ThinLTOCodegenerator, it has an option to save the object file outputs into a directory which is essential for debug info. Tools like lldb and dsymutil will look for these object files for debug info. On Darwin platform, you can link fat binaries with one single clang driver invocation like: $ clang -arch x86_64 -arch i386 -Wl,-object_path_lto,$TMPDIR ... Unfornately, the output object files for one architecture is going to overwrite the previous ones and one architecture slice will end up with no debug info. One example for this is to turn on ThinLTO for sanitizer dylibs in compiler-rt project. To fix the issue, add the name for the architecture into the name of the output object file. rdar://problem/35482935 Reviewers: tejohnson, bd1976llvm, dexonsmith, JDevlieghere Reviewed By: dexonsmith Subscribers: mehdi_amini, aprantl, inglorion, eraman, hiraditya, jkorous, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60924 llvm-svn: 359508
* [WebAssembly] Define the signature for __stack_chk_failDan Gohman2019-04-291-1/+9
| | | | | | | | | | | | | | | The WebAssembly backend needs to know the signatures of all runtime libcall functions. This adds the signature for __stack_chk_fail which was previously missing. Also, make the error message for a missing libcall include the name of the function. Differential Revision: https://reviews.llvm.org/D59521 Reviewed By: sbc100 llvm-svn: 359505
* [PowerPC] Try harder to avoid load/move-to VSR for partial vector loadsRoland Froese2019-04-291-15/+36
| | | | | | | | | | Change the PPCISelLowering.cpp function that decides to avoid update form in favor of partial vector loads to know about newer load types and to not be confused by the chain operand. Differential Revision: https://reviews.llvm.org/D60102 llvm-svn: 359504
* [GlobalISel][AArch64] Select llvm.aarch64.crypto.sha1hJessica Paquette2019-04-291-5/+68
| | | | | | | | | | This was falling back and gives us a reason to create a selectIntrinsic function which we would need eventually anyway. Update arm64-crypto.ll to show that we correctly select it. Also factor out the code for finding an intrinsic ID. llvm-svn: 359501
* [X86] Run CFIInstrInserter on Windows if Dwarf is usedMartin Storsjo2019-04-291-1/+5
| | | | | | | | | | | This is necessary since SVN r330706, as tail merging can include CFI instructions since then. This fixes PR40322 and PR40012. Differential Revision: https://reviews.llvm.org/D61252 llvm-svn: 359496
* [X86][SSE] isHorizontalBinOp - add support for target shufflesSimon Pilgrim2019-04-291-30/+49
| | | | | | | | | | | | Add target shuffle decoding to isHorizontalBinOp as well as ISD::VECTOR_SHUFFLE support. This does mean we can go through bitcasts so we need to bitcast the extracted args to ensure they are the correct type Fixes PR39936 and should help with PR39920/PR39921 Differential Revision: https://reviews.llvm.org/D61245 llvm-svn: 359491
* computePolynomialFromPointer - add missing early-out return for non-pointer ↵Simon Pilgrim2019-04-291-0/+1
| | | | | | | | types. Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359486
* [InstCombine] reduce code duplication; NFCSanjay Patel2019-04-291-5/+7
| | | | | | | | | | Follow-up to: rL359482 Avoid this potential problem throughout by giving the type a name and verifying the assumption that both operands are the same type. llvm-svn: 359485
* Remove duplicate line. NFCI.Simon Pilgrim2019-04-291-1/+0
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359483
* [InstCombine] visitFCmpInst - appease copy+paste pattern warning. NFCI.Simon Pilgrim2019-04-291-1/+1
| | | | | | | | PVS Studio's copy+paste recognizer was seeing this as a typo, technically Op0/Op1 in a fcmp should always be the same type, but we might as well avoid the issue. Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359482
* [globalisel] Improve Legalizer debug outputDaniel Sanders2019-04-292-6/+62
| | | | | | | | | | * LegalizeAction should be printed by name rather than number * Newly created instructions are incomplete at the point the observer first sees them. They are therefore recorded in a small vector and printed just before the legalizer moves on to another instruction. By this point, the instruction must be complete. llvm-svn: 359481
* [CommandLine] Don't allow unlimitted dashes for options. Part 1 or 5Don Hinton2019-04-291-4/+4
| | | | | | | | | | | | | | | | | | | Summary: Prior to this patch, the CommandLine parser would strip an unlimitted number of dashes from options. This patch limits it to two. Reviewers: rnk Reviewed By: rnk Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61229 llvm-svn: 359480
* [X86] scaleShuffleMask - avoid potential signed overflow warning.Simon Pilgrim2019-04-291-3/+3
| | | | | | | | | | Use size_t assignment to prevent a bad explicit type conversion warning. Given the typical size of shuffle masks this was never going to happen, but this at least stops the warning. Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359479
* [TextAPI] Fix Symbol::dump which was failing to append the SymbolKind string.Simon Pilgrim2019-04-291-4/+4
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359478
* [DAG] Refactor DAGCombiner::ReassociateOpsBjorn Pettersson2019-04-291-45/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Extract the logic for doing reassociations from DAGCombiner::reassociateOps into a helper function DAGCombiner::reassociateOpsCommutative, and use that helper to trigger reassociation on the original operand order, or the commuted operand order. Codegen is not identical since the operand order will be different when doing the reassociations for the commuted case. That causes some unfortunate churn in some test cases. Apart from that this should be NFC. Reviewers: spatel, craig.topper, tstellar Reviewed By: spatel Subscribers: dmgreen, dschuff, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, hiraditya, aheejin, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61199 llvm-svn: 359476
* FileCheck [3/12]: Stricter parsing of @LINE expressionsThomas Preud'homme2019-04-291-33/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is part of a patch series to add support for FileCheck numeric expressions. This specific patch gives earlier and better diagnostics for the @LINE expressions. Rather than detect parsing errors at matching time, this commit adds enhance parsing to detect issues with @LINE expressions at parse time and diagnose them more accurately. Copyright: - Linaro (changes up to diff 183612 of revision D55940) - GraphCore (changes in later versions of revision D55940 and in new revision created off D55940) Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield Tags: #llvm Differential Revision: https://reviews.llvm.org/D60383 llvm-svn: 359475
* Avoid "checking a pointer after dereferencing" warning. NFCI.Simon Pilgrim2019-04-291-1/+1
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359473
* Move if() to newline to stop ambiguity over whether it should be else if. NFCI.Simon Pilgrim2019-04-291-1/+2
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359472
* Fix operator precedence warning. NFCI.Simon Pilgrim2019-04-291-1/+2
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359469
* Remove superfluous break from switch statement. NFCI.Simon Pilgrim2019-04-291-1/+0
| | | | | | Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359467
OpenPOWER on IntegriCloud