summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r240302 ("Bring r240130 back.").Daniel Jasper2015-06-233-25/+19
| | | | | | | | | | | | | This causes errors like: ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which may overflow at runtime; recompile with -fPIC blah.cc:function f(): error: undefined reference to '' blah.o:g(): error: undefined reference to '' I have not yet come up with an appropriate reproduction. llvm-svn: 240394
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-23547-713/+713
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* AVX-512: Added all forms of VPABS instructionElena Demikhovsky2015-06-235-71/+105
| | | | | | Added all intrinsics, tests for encoding, tests for intrinsics. llvm-svn: 240386
* MCExpr: Avoid UB by evaluating this shift as unsignedJustin Bogner2015-06-231-1/+1
| | | | | | | | We hit undefined behaviour in some MCExpr tests when the LHS of a left shift is -1. Twos-complement semantics are completely reasonable here, so we should just do the shift in unsigned. llvm-svn: 240385
* [mips] Fix some UB by shifting before sign-extendingJustin Bogner2015-06-231-1/+1
| | | | | | | | Avoid shifting a negative value by sign-extending after the shift. Fixes a couple of tests that were failing under ubsan. llvm-svn: 240381
* Fix PR13851: Preserve metadata for the unswitched branchWeiming Zhao2015-06-231-20/+67
| | | | | | | This patch copies the metadata of the unswitched branch to the newly crreated branch in loop unswitch pass. llvm-svn: 240378
* Handle multiple symbols having the same address.Rafael Espindola2015-06-231-1/+9
| | | | | | I will add an explicit test in a second, but this fixes the bots. llvm-svn: 240372
* [InstCombine] Optimize subtract of selects into a select of a subDavid Majnemer2015-06-231-0/+26
| | | | | | | This came up when examining some code generated by clang's IRGen for certain member pointers. llvm-svn: 240369
* Extract an utility for computing symbol sizes on MachO and COFF.Rafael Espindola2015-06-232-0/+89
| | | | | | I will add a second user in the next commit. llvm-svn: 240366
* AMDGPU: Use getAsInteger instead of atoiMatt Arsenault2015-06-231-3/+5
| | | | llvm-svn: 240365
* [FaultMaps] Move FaultMapParser to Object/Sanjoy Das2015-06-233-36/+62
| | | | | | | | | | | | | | | | | | Summary: That way llvm-objdump can rely on it without adding an extra dependency on CodeGen. This change duplicates the FaultKind enum and the code that serializes it to a string. I could not figure out a way to get around this without adding a new dependency to Object Reviewers: rafael, ab Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10619 llvm-svn: 240364
* [x86] generalize reassociation optimization in machine combiner to 2 ↵Sanjay Patel2015-06-232-95/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instructions Currently ( D10321, http://reviews.llvm.org/rL239486 ), we can use the machine combiner pass to reassociate the following sequence to reduce the critical path: A = ? op ? B = A op X C = B op Y --> A = ? op ? B = X op Y C = A op B 'op' is currently limited to x86 AVX scalar FP adds (with fast-math on), but in theory, it could be any associative math/logic op (see TODO in code comment). This patch generalizes the pattern match to ignore the instruction that defines 'A'. So instead of a sequence of 3 adds, we now only need to find 2 dependent adds and decide if it's worth reassociating them. This generalization has a compile-time cost because we can now match more instruction sequences and we rely more heavily on the machine combiner to discard sequences where reassociation doesn't improve the critical path. For example, in the new test case: A = M div N B = A add X C = B add Y We'll match 2 reassociation patterns, but this transform doesn't reduce the critical path: A = M div N B = A add Y C = B add X We need the combiner to reject that pattern but select this: A = M div N B = X add Y C = B add A Differential Revision: http://reviews.llvm.org/D10460 llvm-svn: 240361
* Re-apply "InstrProf: When reading, copy the data instead of taking a ↵Justin Bogner2015-06-221-47/+65
| | | | | | | | | | | | | | reference. NFC" This version fixes a missing include that MSVC noticed and clarifies the ownership of the counter buffer that's passed to InstrProfRecord. This restores r240206, which was reverted in r240208. Patch by Betul Buyukkurt. llvm-svn: 240360
* Fix PR23914.Evgeniy Stepanov2015-06-221-1/+1
| | | | | | | r226830 moved the declaration of Buf to a nested scope, resulting in a dangling reference (in StringRef Name), and a use-after-free. llvm-svn: 240357
* Code cleanup: Remove std::move() around xvalue (NFC)Logan Chien2015-06-221-1/+1
| | | | | | | | | | | Remove std::move() around xvalue so that copy elision is eligible. In case that copy elision is not appliable, the c++ standard also guarantees the move semantics on xvalue. Thus, it is not necessary to wrap Args with std::move. This also silence a warning since r240345. llvm-svn: 240355
* [LoopDist] Improve variable names and comments in LoopVersioning class, NFCAdam Nemet2015-06-221-25/+29
| | | | | | | | As with the previous patch, the goal is to turn the class into a general loop-versioning class. This patch removes any references to loop distribution. llvm-svn: 240352
* Modify ParseArgs to return the InputArgList by value - there's no need for ↵David Blaikie2015-06-222-21/+21
| | | | | | | | | | | | dynamic allocation/ownership here The one caller that does anything other than keep this variable on the stack is the single use of DerivedArgList in Clang, which is a bit more interesting but can probably be cleaned up/simplified a bit further (have DerivedArgList take ownership of the InputArgList rather than needing to reference its Args indirectly) which I'll try to after this. llvm-svn: 240345
* Revert r240291: causes problems in self-hosted builds.Pawel Bylica2015-06-221-1/+1
| | | | llvm-svn: 240343
* [X86][FMA4] FMA4 ops can perform unaligned folded loads.Simon Pilgrim2015-06-221-64/+64
| | | | llvm-svn: 240342
* Linker: Do not expect comdat to exist in source module.Peter Collingbourne2015-06-221-2/+2
| | | | llvm-svn: 240341
* Fix line endings (NFC)Joseph Tremoulet2015-06-222-40/+40
| | | | | | | I inadvertently checked these in with Windows-style line endings in r240288. llvm-svn: 240340
* [Object] Search for architecures by name in ↵Frederic Riss2015-06-223-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | MachOUniversalBinary::getObjectForArch() The reason we need to search by name rather than by Triple::ArchType is to handle subarchitecture correclty. There is no different ArchType for the x86_64h architecture (it identifies itself as x86_64), or for the various ARM subarches. The only way to get to the subarch slice in an universal binary is to search by name. This issue led to hard to debug and transient symbolication failures in Asan tests (it mostly works, because the files are very similar). This also affects the Profiling infrastucture as it is the other user of that API. Reviewers: samsonov, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10604 llvm-svn: 240339
* R600/SI: Use ELF64 format instead of ELF32Tom Stellard2015-06-223-9/+16
| | | | | | | | | | Reviewers: arsenm, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10392 llvm-svn: 240331
* R600: Use EM_AMDGPU for the ELF Machine typeTom Stellard2015-06-221-1/+1
| | | | | | | | | | Reviewers: arsenm, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10390 llvm-svn: 240330
* [X86] Teach load folding to accept scalar _Int users of MOVSS/MOVSD.Ahmed Bougacha2015-06-221-10/+46
| | | | | | | | | | | | | | | | | | | The _Int instructions are special, in that they operate on the full VR128 instead of FR32. The load folding then looks at MOVSS, at the user, and bails out when it sees a size mismatch. What we really know is that the rm_Int instructions don't load the higher lanes, so folding is fine. This happens for the straightforward intrinsic code, e.g.: _mm_add_ss(a, _mm_load_ss(p)); Fixes PR23349. Differential Revision: http://reviews.llvm.org/D10554 llvm-svn: 240326
* MIR Serialization: Introduce a lexer for machine instructions.Alex Lorenz2015-06-224-11/+193
| | | | | | | | | | | | This commit adds a function that tokenizes the string containing the machine instruction. This commit also adds a struct called 'MIToken' which is used to represent the lexer's tokens. Reviewers: Sean Silva Differential Revision: http://reviews.llvm.org/D10521 llvm-svn: 240323
* SafeStack: Create the unsafe stack pointer on demand.Peter Collingbourne2015-06-221-3/+4
| | | | | | | This avoids creating an unnecessary undefined reference on targets such as NVPTX that require such references to be declared in asm output. llvm-svn: 240321
* Move MCSymbol Value in to the union of Offset and CommonSize.Pete Cooper2015-06-221-0/+4
| | | | | | | | | | | | | | | | This is a reapplication of r239440 which was reverted in r239441. There are no changes to this patch from then, but this had instead exposed a bug in .thumb_set which was fixed in r240318. Having fixed that bug, it is now safe to re-apply this code. Original commit message below: It wasn't possible to have a variable Symbol with offset or 'isCommon' so this just enables better packing of the MCSymbol class. Reviewed by Rafael Espindola. llvm-svn: 240320
* Change .thumb_set to have the same error checks as .set.Pete Cooper2015-06-222-84/+112
| | | | | | | | | | | | | | According to the documentation, .thumb_set is 'the equivalent of a .set directive'. We didn't have equivalent behaviour in terms of all the errors we could throw, for example, when a symbol is redefined. This change refactors parseAssignment so that it can be used by .set and .thumb_set and implements tests for .thumb_set for all the errors thrown by that method. Reviewed by Rafael Espíndola. llvm-svn: 240318
* [x86] set default reciprocal (division and square root) codegen to match GCCSanjay Patel2015-06-221-6/+9
| | | | | | | | | | | | | | | | D8982 ( checked in at http://reviews.llvm.org/rL239001 ) added command-line options to allow reciprocal estimate instructions to be used in place of divisions and square roots. This patch changes the default settings for x86 targets to allow that recip codegen (except for scalar division because that breaks too much code) when using -ffast-math or its equivalent. This matches GCC behavior for this kind of codegen. Differential Revision: http://reviews.llvm.org/D10396 llvm-svn: 240310
* Fix MSVC build.Sanjoy Das2015-06-221-4/+3
| | | | | | | | I had some unnecessary `typename`s left in after addressing review. This compiled successfully with clang++ but MSVC reported an error. Fix the build error by removing the redundant `typename`s. llvm-svn: 240307
* Remove the IsStreamed member variable.Rafael Espindola2015-06-221-15/+9
| | | | | | | | | | | | | | | | | | Having different code paths for streamed and regular bitcode reading was a source of bugs in the past and this defines them away. It has a small but noticeable impact on performance. I timed running "opt -disable-output -disable-verify" on a ltoed clang. It goes from 14.752845231 seconds time elapsed ( +- 0.16% ) to 15.012463721 seconds time elapsed ( +- 0.11% ) Extracted from a patch by Karl Schimpf. llvm-svn: 240305
* [FaultMaps] Add a parser for the __llvm__faultmaps section.Sanjoy Das2015-06-221-0/+37
| | | | | | | | | | | | | | | Summary: The parser is exercised by llvm-objdump using -print-fault-maps. As is probably obvious, the code itself was "heavily inspired" by http://reviews.llvm.org/D10434. Reviewers: reames, atrick, JosephTremoulet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10491 llvm-svn: 240304
* Bring r240130 back.Rafael Espindola2015-06-223-19/+25
| | | | | | | | | | | | | | | | | | | | | | Now that pr23900 is fixed, we can bring it back with no changes. Original message: Make all temporary symbols unnamed. What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240302
* Avoid a Symbol -> Name -> Symbol conversion.Rafael Espindola2015-06-2211-39/+71
| | | | | | | | | | | | | | Before this we were producing a TargetExternalSymbol from a MCSymbol. That meant extracting the symbol name and fetching the symbol again down the pipeline. This patch adds a DAG.getMCSymbol that lets the MCSymbol pass unchanged on the DAG. Doing so removes the need for MO_NOPREFIX and fixes the root cause of pr23900, allowing r240130 to be committed again. llvm-svn: 240300
* MIR Serialization: Serialize machine instruction names.Alex Lorenz2015-06-225-3/+185
| | | | | | | | | | | | | | | | This commit implements initial machine instruction serialization. It serializes machine instruction names. The instructions are represented using a YAML sequence of string literals and are a part of machine basic block YAML mapping. This commit introduces a class called 'MIParser' which will be used to parse the machine instructions and operands. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10481 llvm-svn: 240295
* Fix shl folding in DAG combiner.Pawel Bylica2015-06-221-1/+1
| | | | | | | | | | | | | | | | Summary: The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared. Test Plan: A regression test included. Reviewers: andreadb Reviewed By: andreadb Subscribers: andreadb, test, llvm-commits Differential Revision: http://reviews.llvm.org/D10602 llvm-svn: 240291
* [ORC] Add NullResolverJoseph Tremoulet2015-06-222-12/+40
| | | | | | | | | | | | | | | | | Summary: This is an implementation of RuntimeDyld::SymbolResolver that simply rejects all resolution requests; useful for clients that do not have any cross-object symbol references. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10455 llvm-svn: 240288
* [mips] [IAS] Add support for LAReg with identical source and destination ↵Toma Tabacu2015-06-221-15/+25
| | | | | | | | | | | | | | | | register operands. Summary: In this case, we're supposed to load the immediate in AT and then ADDu it with the source register and put it in the destination register. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9367 llvm-svn: 240278
* AVX-512: added VPSHUFB instruction - all SKX formsElena Demikhovsky2015-06-222-0/+19
| | | | | | Added intrinsics and encoding tests. llvm-svn: 240277
* [mips] [IAS] Add support for LASym with identical source and destination ↵Toma Tabacu2015-06-221-8/+20
| | | | | | | | | | | | | | | | | | register operands. Summary: In this case, we're supposed to load the address of the symbol in AT and then ADDu it with the source register and put it in the destination register. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9366 llvm-svn: 240273
* AVX-512: All forms of VCOPMRESS VEXPAND instructions,Elena Demikhovsky2015-06-223-79/+32
| | | | | | encoding tests. llvm-svn: 240272
* Reverted AVX-512 vector shuffleElena Demikhovsky2015-06-221-180/+64
| | | | llvm-svn: 240258
* [X86] Allow more call sequences to use push instructions for argument passingMichael Kuperstein2015-06-221-26/+91
| | | | | | | | | This allows more call sequences to use pushes instead of movs when optimizing for size. In particular, calling conventions that pass some parameters in registers (e.g. thiscall) are now supported. Differential Revision: http://reviews.llvm.org/D10500 llvm-svn: 240257
* AVX-512: Added intrinsics for VPERMT2W/D/Q/PS/PD andElena Demikhovsky2015-06-222-3/+123
| | | | | | | VPERMI2W/D/Q/PS/PD instructions. Added tests. llvm-svn: 240256
* [PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class.Chandler Carruth2015-06-2218-119/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow classes to implement the AA interface without deriving from the class or referencing an internal enum of some other class as their return types. Also, to a pretty fundamental extent, concepts such as 'NoAlias', 'MayAlias', and 'MustAlias' are first class concepts in LLVM and we aren't saving anything by scoping them heavily. My mild preference would have been to use a scoped enum, but that feature is essentially completely broken AFAICT. I'm extremely disappointed. For example, we cannot through any reasonable[1] means construct an enum class (or analog) which has scoped names but converts to a boolean in order to test for the possibility of aliasing. [1]: Richard Smith came up with a "solution", but it requires class templates, and lots of boilerplate setting up the enumeration multiple times. Something like Boost.PP could potentially bundle this up, but even that would be quite painful and it doesn't seem realistically worth it. The enum class solution would probably work without the need for a bool conversion. Differential Revision: http://reviews.llvm.org/D10495 llvm-svn: 240255
* [PM/AA] Rework the names and comments in AliasSetTracker to moreChandler Carruth2015-06-221-24/+24
| | | | | | | | | | | | | | | | | | | | accurately describe what is being tracked. While these two enums do track mod/ref information and aliasing information, they don't represent the exact same things as either the mod/ref enums or the alias result enum in AA. They're definitions are dominated by the structure of their lattice and the bit's various semantics. This patch just calls them what they are and tries to spell out usefully distinct names for these things. This will clear the path for using a raw unscoped enum to represent some of these concepts across LLVM's analysis library. No functionality changed here. Differential Revision: http://reviews.llvm.org/D10494 llvm-svn: 240254
* [X86] Code tidyup - Use SDValue bool operator. NFC.Simon Pilgrim2015-06-211-47/+25
| | | | llvm-svn: 240249
* AsmPrinter: Don't emit empty .debug_loc entriesDuncan P. N. Exon Smith2015-06-215-14/+122
| | | | | | | | | | | If we don't know how to represent a .debug_loc entry, skip the entry entirely rather than emitting an empty one. Similarly, if a .debug_loc list has no entries, don't create the list. We still want to create the variables, just in an optimized-out form that doesn't have a DW_AT_location. llvm-svn: 240244
* AsmPrinter: Rewrite initialization of DbgVariable, NFCDuncan P. N. Exon Smith2015-06-213-64/+85
| | | | | | | | | | | | | | | | | | | | | | | There are three types of `DbgVariable`: - alloca variables, created based on the MMI table, - register variables, created based on DBG_VALUE instructions, and - optimized-out variables. This commit reconfigures `DbgVariable` to make it easier to tell which kind we have, and make initialization a little clearer. For MMI/alloca variables, `FrameIndex.size()` must always equal `Expr.size()`, and there shouldn't be an `MInsn`. For register variables (with a `MInsn`), `FrameIndex` must be empty, and `Expr` should have 0 or 1 element depending on whether it has a complex expression (registers with multiple locations use `DebugLocListIndex`). Optimized-out variables shouldn't have any of these fields. Moreover, this separates DBG_VALUE initialization until after the variable is created, simplifying logic in a future commit that changes `collectVariableInfo()` to stop creating empty .debug_loc entries/lists. llvm-svn: 240243
OpenPOWER on IntegriCloud