summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
...
* MachO: enable .data_region directives everywhereTim Northover2016-04-211-6/+0
| | | | | | | | | | We'd disabled them on x86 because back in the early days some host tools couldn't handle the new load commands. This no longer holds: anyone capable of deploying Clang should be able to deploy its copies of ar/ranlib/etc. rdar://25254790 llvm-svn: 267075
* [Support] Fix Wcast-qual warningVedant Kumar2016-04-211-1/+2
| | | | llvm-svn: 267072
* Fix PDB warnings and testReid Kleckner2016-04-211-0/+9
| | | | llvm-svn: 267071
* Improve error message reporting for MachineFunctionPropertiesDerek Schuff2016-04-211-1/+3
| | | | | | | | When printing the properties required by a pass, only print the properties that are set, and not those that are clear (only properties that are set are verified, clear properties are "don't-care"). llvm-svn: 267070
* [esan] EfficiencySanitizer instrumentation passDerek Bruening2016-04-212-0/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: Adds an instrumentation pass for the new EfficiencySanitizer ("esan") performance tuning family of tools. Multiple tools will be supported within the same framework. Preliminary support for a cache fragmentation tool is included here. The shared instrumentation includes: + Turn mem{set,cpy,move} instrinsics into library calls. + Slowpath instrumentation of loads and stores via callouts to the runtime library. + Fastpath instrumentation will be per-tool. + Which memory accesses to ignore will be per-tool. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, vkalintiris, pcc, silvas, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19167 llvm-svn: 267058
* Add utility function to manipulate attributes on CallSite. NFCAmaury Sechet2016-04-212-0/+22
| | | | | | | | | | | | Summary: As per title. This will help work on the C API. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19173 llvm-svn: 267057
* [ProfileData] Report errors from InstrProfSymtab::createVedant Kumar2016-04-211-1/+1
| | | | | | | | | | | InstrProfSymtab::create can fail with instrprof_error::malformed, but this error is silently dropped. Propagate the error up to the caller so we fail early. Eventually, I'd like to transition ProfileData over to the new Error class so we can't ignore hard failures like this. llvm-svn: 267055
* [MachineBasicBlock] Make the pass argument truly mandatory whenQuentin Colombet2016-04-211-1/+1
| | | | | | | | | | | | | | splitting edges. MachineBasicBlock::SplitCriticalEdges will crash if a nullptr would have been passed for the Pass argument. Do not allow that by turning this argument into a reference. The alternative would have been to make the Pass a truly optional argument, but although this is easy to do, I was afraid users using it like this would not be aware the livness information, dominator tree and such would silently be broken. llvm-svn: 267052
* Refactor raw pdb dumper into libraryZachary Turner2016-04-215-30/+173
| | | | | | | | | | | | | | | | | | PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the parsing of this code into DebugInfoPDB and makes the dumper use this. This is achieved by implementing the skeleton of RawPdbSession, the non-DIA counterpart to the existing PDB read interface. None of the type / source file / etc information is accessible yet, so this implementation is not yet close to achieving parity with the DIA counterpart, but the RawSession class simply holds a reference to a PDBFile class which handles parsing the file format. Additionally a PDBStream class is introduced which allows accessing the bytes of a particular stream in a PDB file. Differential Revision: http://reviews.llvm.org/D19343 Reviewed By: majnemer llvm-svn: 267049
* [MachineBasicBlock] Refactor SplitCriticalEdge to expose a query API.Quentin Colombet2016-04-211-0/+6
| | | | | | | | | Introduce canSplitCriticalEdge, so that clients can now query whether or not a critical edge can be split without actually needing to split it. This may be useful when gathering information for cost models for instance. llvm-svn: 267046
* [RegisterBankInfo] Change the API for the verify methods.Quentin Colombet2016-04-212-5/+26
| | | | | | | Return bool instead of void so that it is natural to put the calls into asserts. llvm-svn: 267033
* LegalizeDAG: Move unaligned load/store expansion to TLIMatt Arsenault2016-04-211-0/+9
| | | | | | | | When custom lowered, this is not called if the store is custom lowered. Move it to be a utility function so targets can easily expand unaligned accesses when custom lowering. llvm-svn: 267029
* [RegisterBankInfo] Change the representation of the partial mappings.Quentin Colombet2016-04-211-7/+20
| | | | | | | | | Instead of holding a mask, hold two value: the start index and the length of the mapping. This is a more compact representation, although less powerful. That being said, arbitrary masks would not have worked for the generic so do not allow them in the first place. llvm-svn: 267025
* Initial implementation of optimization bisect support.Andrew Kaylor2016-04-216-10/+178
| | | | | | | | | | | | This patch implements a optimization bisect feature, which will allow optimizations to be selectively disabled at compile time in order to track down test failures that are caused by incorrect optimizations. The bisection is enabled using a new command line option (-opt-bisect-limit). Individual passes that may be skipped call the OptBisect object (via an LLVMContext) to see if they should be skipped based on the bisect limit. A finer level of control (disabling individual transformations) can be managed through an addition OptBisect method, but this is not yet used. The skip checking in this implementation is based on (and replaces) the skipOptnoneFunction check. Where that check was being called, a new call has been inserted in its place which checks the bisect limit and the optnone attribute. A new function call has been added for module and SCC passes that behaves in a similar way. Differential Revision: http://reviews.llvm.org/D19172 llvm-svn: 267022
* Split IntrReadArgMem into IntrReadMem and IntrArgMemOnlyNicolai Haehnle2016-04-2111-364/+354
| | | | | | | | | | | | | | | | | | Summary: IntrReadWriteArgMem simply becomes IntrArgMemOnly. So there are fewer intrinsic properties that express their orthogonality better, and correspond more closely to the corresponding IR attributes. Suggested by: Philip Reames Reviewers: joker.eph, reames, tstellarAMD Subscribers: jholewinski, arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D19291 llvm-svn: 267021
* [LoopUtils] Fix typo in commentAdam Nemet2016-04-211-1/+1
| | | | llvm-svn: 267016
* [LoopUtils] Rename {check->find}StringMetadata{Into->For}Loop. NFCAdam Nemet2016-04-211-3/+3
| | | | | | | | "Into" was misleading. I am also planning to use this helper to look for loop metadata and return the argument, so find seems like a better name. llvm-svn: 267013
* Fixed Dwarf debug info emission to skip DILexicalBlockFile entries.Amjad Aboud2016-04-211-0/+6
| | | | | | | | Before this fix, DILexicalBlockFile entries were skipped only in some cases and were not in other cases. Differential Revision: http://reviews.llvm.org/D18724 llvm-svn: 267004
* Address Philip's post-commit feedback for r266987. NFC.Chad Rosier2016-04-211-6/+6
| | | | llvm-svn: 266998
* Minor comment cleanup [NFC]Philip Reames2016-04-211-4/+4
| | | | llvm-svn: 266997
* Refactor implied condition logic from ValueTracking directly into CmpInst. NFC.Chad Rosier2016-04-211-0/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D19330 llvm-svn: 266987
* [mips][microMIPS] Add R_MICROMIPS_PC26_S1 relocationZoran Jovanovic2016-04-211-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D14822 llvm-svn: 266985
* Add a CachedHash structure.Rafael Espindola2016-04-211-0/+30
| | | | | | | | | | | | | A DenseMap doesn't store the hashes, so it needs to recompute them when the table is resized. In some applications the hashing cost is noticeable. That is the case for example in lld for symbol names (StringRef). This patch adds a templated structure that can wraps any value that can go in a DenseMap and caches the hash. llvm-svn: 266981
* ThinLTO: initialize variablesMehdi Amini2016-04-211-2/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266964
* ThinLTO: add module caching handling.Mehdi Amini2016-04-212-0/+23
| | | | | | | Differential Revision: http://reviews.llvm.org/D18494 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266959
* ThinLTO/ModuleLinker: add a flag to not always pull-in linkonce when ↵Mehdi Amini2016-04-212-2/+9
| | | | | | | | | | | | | | | | | | | performing importing Summary: The function importer already decided what symbols need to be pulled in. Also these magically added ones will not be in the export list for the source module, which can confuse the internalizer for instance. Reviewers: tejohnson, rafael Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19096 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266948
* Add optimization for 'icmp slt (or A, B), A' and some related idioms based ↵Nick Lewycky2016-04-212-0/+44
| | | | | | | | | | | | | | | | | | | | on knowledge of the sign bit for A and B. No matter what value you OR in to A, the result of (or A, B) is going to be UGE A. When A and B are positive, it's SGE too. If A is negative, OR'ing a value into it can't make it positive, but can increase its value closer to -1, therefore (or A, B) is SGE A. Working through all possible combinations produces this truth table: ``` A is +, -, +/- F F F + B is T F ? - ? F ? +/- ``` The related optimizations are flipping the 'slt' for 'sge' which always NOTs the result (if the result is known), and swapping the LHS and RHS while swapping the comparison predicate. There are more idioms left to implement (aren't there always!) but I've stopped here because any more would risk becoming unreasonable for reviewers. llvm-svn: 266939
* Thread Expected<...> up from libObject’s getName() for symbols to allow ↵Kevin Enderby2016-04-206-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | llvm-objdump to produce a good error message. Produce another specific error message for a malformed Mach-O file when a symbol’s string index is past the end of the string table. The existing test case in test/Object/macho-invalid.test for macho-invalid-symbol-name-past-eof now reports the error with the message indicating that a symbol at a specific index has a bad sting index and that bad string index value. Again converting interfaces to Expected<> from ErrorOr<> does involve touching a number of places. Where the existing code reported the error with a string message or an error code it was converted to do the same. There is some code for this that could be factored into a routine but I would like to leave that for the code owners post-commit to do as they want for handling an llvm::Error. An example of how this could be done is shown in the diff in lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h which had a Check() routine already for std::error_code so I added one like it for llvm::Error . Also there some were bugs in the existing code that did not deal with the old ErrorOr<> return values.  So now with Expected<> since they must be checked and the error handled, I added a TODO and a comment: “// TODO: Actually report errors helpfully” and a call something like consumeError(NameOrErr.takeError()) so the buggy code will not crash since needed to deal with the Error. Note there fixes needed to lld that goes along with this that I will commit right after this. So expect lld not to built after this commit and before the next one. llvm-svn: 266919
* IR: Use SmallVector instead of std::vector of TrackingMDRefDuncan P. N. Exon Smith2016-04-201-1/+5
| | | | | | | | | | Don't use std::vector<TrackingMDRef>, since (at least in some versions of libc++) std::vector apparently copies values on grow operations instead of moving them. Found this when I was temporarily deleting the copy constructor for TrackingMDRef to investigate a performance bottleneck. llvm-svn: 266909
* [ValueTracking] Make isImpliedCondition return an Optional<bool>. NFC.Chad Rosier2016-04-201-7/+8
| | | | | | Phabricator Revision: http://reviews.llvm.org/D19277 llvm-svn: 266904
* IR: Avoid mallocs in constructor of ModuleSlotTrackerDuncan P. N. Exon Smith2016-04-201-1/+5
| | | | | | | | A ModuleSlotTracker can be created without actually being used (e.g., r266889 added one to the Verifier). Create the SlotTracker within it lazily on the first call to ModuleSlotTracker::getMachine. llvm-svn: 266902
* LTO: Verify the input even if optimize() isn't calledDuncan P. N. Exon Smith2016-04-201-0/+17
| | | | | | | | | | | | | | Clients may call writeMergedModules before calling optimize, or call compileOptimized without calling optimize. Make sure they don't sneak past the verifier. This adds LTOCodeGenerator::verifyMergedModuleOnce, and calls it from writeMergedModule, optimize, and codegenOptimized. I couldn't find a good way to test this. I tried writing broken IR to send into llvm-lto, but LTOCodeGenerator doesn't understand textual IR, and assembler runs the verifier itself anyway. Checking in valid-but-doesn't-verify bitcode here doesn't seem valuable. llvm-svn: 266894
* IR: Use a single ModuleSlotTracker in the VerifierDuncan P. N. Exon Smith2016-04-201-0/+2
| | | | | | | | | | | | Speed up Verifier output by sharing a single ModuleSlotTracker for the duration. There should be no functionality change here except for much faster output when there's more than one statement. Now the Verifier won't be traversing the full Metadata graph every time it prints an error. The TypePrinter is still not shared, but that would take some extra plumbing. llvm-svn: 266889
* [ThinLTO] Prevent importing of "llvm.used" valuesTeresa Johnson2016-04-202-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch prevents importing from (and therefore exporting from) any module with a "llvm.used" local value. Local values need to be promoted and renamed when importing, and their presense on the llvm.used variable indicates that there are opaque uses that won't see the rename. One such example is a use in inline assembly. See also the discussion at: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html As part of this, move collectUsedGlobalVariables out of Transforms/Utils and into IR/Module so that it can be used more widely. There are several other places in LLVM that used copies of this code that can be cleaned up as a follow on NFC patch. Reviewers: joker.eph Subscribers: pcc, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D18986 llvm-svn: 266877
* Add LLVMGetAttrKindID in the C API in order to facilitate migration away ↵Amaury Sechet2016-04-201-0/+13
| | | | | | | | | | | | | | | | | from LLVMAttribute Summary: LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values. See D18749 for reference. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19081 llvm-svn: 266842
* IR: Use HANDLE_METADATA_LEAF to define MetadataKind enum, NFCDuncan P. N. Exon Smith2016-04-201-28/+2
| | | | llvm-svn: 266839
* ScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable ↵Mehdi Amini2016-04-201-4/+2
| | | | | | | to a member From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266837
* Add IntrWrite[Arg]Mem intrinsic propertyNicolai Haehnle2016-04-192-1/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: This property is used to mark an intrinsic that only writes to memory, but neither reads from memory nor has other side effects. An example where this is useful is the llvm.amdgcn.buffer.store.format.* intrinsic, which corresponds to a store instruction that goes through a special buffer descriptor rather than through a plain pointer. With this property, the intrinsic should still be handled as having side effects at the LLVM IR level, but machine scheduling can make smarter decisions. Reviewers: tstellarAMD, arsenm, joker.eph, reames Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D18291 llvm-svn: 266826
* Remove duplicated header contents, NFCVedant Kumar2016-04-191-102/+0
| | | | | | | It looks like InstrProfiling.h was the victim of a bad merge. The header guards in the file prevented the build from blowing up. llvm-svn: 266822
* [AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.Marcin Koscielnicki2016-04-193-6/+3
| | | | | | | | | | | | | | Both AArch64 and ARM support llvm.<arch>.thread.pointer intrinsics that just return the thread pointer. I have a pending patch that does the same for SystemZ (D19054), and there are many more targets that could benefit from one. This patch merges the ARM and AArch64 intrinsics into a single target independent one that will also be used by subsequent targets. Differential Revision: http://reviews.llvm.org/D19098 llvm-svn: 266818
* [Orc] Add move ops for OrcRemoteTargetClient and OrcRemoteTargetServer toLang Hames2016-04-192-0/+31
| | | | | | appease MSVC. llvm-svn: 266812
* [PPC, SSP] Support PowerPC Linux stack protection.Tim Shen2016-04-191-1/+1
| | | | llvm-svn: 266809
* [SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARDTim Shen2016-04-192-0/+3
| | | | | | | | | | | | | | | | | | | | | | | With this change, ideally IR pass can always generate llvm.stackguard call to get the stack guard; but for now there are still IR form stack guard customizations around (see getIRStackGuard()). Future SSP customization should go through LOAD_STACK_GUARD. There is a behavior change: stack guard values are not CSEed anymore, since we should never reuse the value in case that it has been spilled (and corrupted). See ssp-guard-spill.ll. This also cause the change of stack size and codegen in X86 and AArch64 test cases. Ideally we'd like to know if the guard created in llvm.stackprotector() gets spilled or not. If the value is spilled, discard the value and reload stack guard; otherwise reuse the value. This can be done by teaching register allocator to know how to rematerialize LOAD_STACK_GUARD and force a rematerialization (which seems hard), or check for spilling in expandPostRAPseudo. It only makes sense when the stack guard is a global variable, which requires more instructions to load. Anyway, this seems to go out of the scope of the current patch. llvm-svn: 266806
* [Orc] Add explicit move ops to OrcRemoteTargetRPCAPI for MSVC.Lang Hames2016-04-191-0/+11
| | | | llvm-svn: 266805
* [Orc] Fix missing return in RPC move assignment operator.Lang Hames2016-04-191-0/+1
| | | | llvm-svn: 266804
* [ValueTracking, VectorUtils] Refactor getIntrinsicIDForCallDavid Majnemer2016-04-192-20/+16
| | | | | | | | | | | | | The functionality contained within getIntrinsicIDForCall is two-fold: it checks if a CallInst's callee is a vectorizable intrinsic. If it isn't an intrinsic, it attempts to map the call's target to a suitable intrinsic. Move the mapping functionality into getIntrinsicForCallSite and rename getIntrinsicIDForCall to getVectorIntrinsicIDForCall while reimplementing it in terms of getIntrinsicForCallSite. llvm-svn: 266801
* IR: Enable debug info type ODR uniquing for forward declsDuncan P. N. Exon Smith2016-04-191-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | Add a new method, DICompositeType::buildODRType, that will create or mutate the DICompositeType for a given ODR identifier, and use it in LLParser and BitcodeReader instead of DICompositeType::getODRType. The logic is as follows: - If there's no node, create one with the given arguments. - Else, if the current node is a forward declaration and the new arguments would create a definition, mutate the node to match the new arguments. - Else, return the old node. This adds a missing feature supported by the current DITypeIdentifierMap (which I'm slowly making redudant). The only remaining difference is that the DITypeIdentifierMap has a "the-last-one-wins" rule, whereas DICompositeType::buildODRType has a "the-first-one-wins" rule. For now I'm leaving behind DICompositeType::getODRType since it has obvious, low-level semantics that are convenient for unit testing. llvm-svn: 266786
* [llvm-pdbdump] Print a better error message when PDB loading fails.Zachary Turner2016-04-191-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D19234 llvm-svn: 266772
* [Orc] Add move ops to RPC to satisfy MSVC.Lang Hames2016-04-191-0/+23
| | | | llvm-svn: 266768
* [ValueTracking] Improve isImpliedCondition for conditions with matching ↵Chad Rosier2016-04-191-6/+8
| | | | | | | | | | | | | | | operands. This patch improves SimplifyCFG to catch cases like: if (a < b) { if (a > b) <- known to be false unreachable; } Phabricator Revision: http://reviews.llvm.org/D18905 llvm-svn: 266767
OpenPOWER on IntegriCloud