summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2016-11-12[ORC] Add a WrappedHandlerReturn type to map handler return types onto errorLang Hames
return types. This class allows user provided handlers to return either error-wrapped types or plain types. In the latter case, the plain type is wrapped with a success value of Error or Expected<T> type to fit it into the rest of the serialization machinery. This patch allows us to remove the RPC unit-test workaround added in r286646. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286701 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12One more set of changes to fix formatv() on linux.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12Add missing #include.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12Fix another problem with formatv().Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12Try to fix build after llvm::formatv() patch.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[Support] Introduce llvm::formatv() function.Zachary Turner
This introduces a new type-safe general purpose formatting library. It provides compile-time type safety, does not require a format specifier (since the type is deduced), and provides mechanisms for extending the format capability to user defined types, and overriding the formatting behavior for existing types. This patch additionally adds documentation for the API to the LLVM programmer's manual. Mailing List Thread: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html Differential Revision: https://reviews.llvm.org/D25587 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Define DbiStreamBuilder::addSectionContribs.Rui Ueyama
This patch defines a new function to add a SectionContribs stream to a PDB file. Unlike SectionMap, SectionContribs contains a list of input sections as opposed to output sections. Note that this patch needs improving because currently we do not set Module field in SectionContribs entries. In a follow-up patch, I'll add Modules and then fix it after that. Differential Revision: https://reviews.llvm.org/D26210 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[RPC] Add const qualifier to MemberFnWrapper to make buildbots happy.Lang Hames
This is a temporary fix: The right solution is to make sure addHandler can support mutable lambdas. I'll add that in a follow-up patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Fix typo in comment.Rui Ueyama
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Revert "(origin/master, origin/HEAD) MachineScheduler/ScheduleDAG: Add ↵Matthias Braun
support to skipping a node." Revert accidentally committed change. This reverts commit r286655. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11MachineScheduler/ScheduleDAG: Add support to skipping a node.Matthias Braun
The DAG mutators in the scheduler cannot really remove DAG nodes as additional anlysis information such as ScheduleDAGToplogicalSort are already computed at this point and rely on a fixed number of DAG nodes. Alleviate the missing removal with a new flag: Setting the new skip flag on a node ignores it during scheduling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11ScheduleDAGInstrs: Move VRegUses to ScheduleDAGMILive; NFCIMatthias Braun
Push VRegUses/collectVRegUses() down the class hierarchy towards its only user ScheduleDAGMILive. NFCI: The initialization of the map happens at a later point but that should not matter. This is in preparation to allow DAG mutators to merge nodes, which relies on this map getting computed later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[ORC] Re-apply 286620 with fixes for the ErrorSuccess class.Lang Hames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[PowerPC] Add remaining vector permute builtins in altivec.h - LLVM portionNemanja Ivanovic
This patch corresponds to review: https://reviews.llvm.org/D26480 Adds all the intrinsics used for various permute builtins that will be added to altivec.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Make the FunctionComparator of the MergeFunctions pass a stand-alone utility.Erik Eckstein
This is pure refactoring. NFC. This change moves the FunctionComparator (together with the GlobalNumberState utility) in to a separate file so that it can be used by other passes. For example, the SwiftMergeFunctions pass in the Swift compiler: https://github.com/apple/swift/blob/master/lib/LLVMPasses/LLVMMergeFunctions.cpp Details of the change: *) The big part is just moving code out of MergeFunctions.cpp into FunctionComparator.h/cpp *) Make FunctionComparator member functions protected (instead of private) so that a derived comparator class can use them. Following refactoring helps to share code between the base FunctionComparator class and a derived class: *) Add a beginCompare() function *) Move some basic function property comparisons into a separate function compareSignature() *) Do the GEP comparison inside cmpOperations() which now has a new needToCmpOperands reference parameter https://reviews.llvm.org/D25385 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286632 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Bitcode: Change getModuleSummaryIndex() to return an llvm::Expected.Peter Collingbourne
Differential Revision: https://reviews.llvm.org/D26539 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Bitcode: Clean up error handling for certain bitcode query functions.Peter Collingbourne
The functions getBitcodeTargetTriple(), isBitcodeContainingObjCCategory(), getBitcodeProducerString() and hasGlobalValueSummary() now return errors via their return value rather than via the diagnostic handler. To make this work, re-implement these functions using non-member functions so that they can be used without the LLVMContext required by BitcodeReader. Differential Revision: https://reviews.llvm.org/D26532 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[ORC] Revert r286620 while I investigate a bot failure.Lang Hames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[ORC] Refactor the ORC RPC utilities to add some new features.Lang Hames
(1) Add support for function key negotiation. The previous version of the RPC required both sides to maintain the same enumeration for functions in the API. This means that any version skew between the client and server would result in communication failure. With this version of the patch functions (and serializable types) are defined with string names, and the derived function signature strings are used to negotiate the actual function keys (which are used for efficient call serialization). This allows clients to connect to any server that supports a superset of the API (based on the function signatures it supports). (2) Add a callAsync primitive. The callAsync primitive can be used to install a return value handler that will run as soon as the RPC function's return value is sent back from the remote. (3) Launch policies for RPC function handlers. The new addHandler method, which installs handlers for RPC functions, takes two arguments: (1) the handler itself, and (2) an optional "launch policy". When the RPC function is called, the launch policy (if present) is invoked to actually launch the handler. This allows the handler to be spawned on a background thread, or added to a work list. If no launch policy is used, the handler is run on the server thread itself. This should only be used for short-running handlers, or entirely synchronous RPC APIs. (4) Zero cost cross type serialization. You can now define serialization from any type to a different "wire" type. For example, this allows you to call an RPC function that's defined to take a std::string while passing a StringRef argument. If a serializer from StringRef to std::string has been defined for the channel type this will be used to serialize the argument without having to construct a std::string instance. This allows buffer reference types to be used as arguments to RPC calls without requiring a copy of the buffer to be made. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Fix comments according to the LLVM coding guidelines.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Fix windows buildbot where warnings are errors. We had a switch statement ↵Greg Clayton
where all enumerations were handled, but some compilers don't recognize this. Simplify the logic so that all compilers will know a return value is returned in all cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Clean up DWARFFormValue by reducing duplicated code and removing ↵Greg Clayton
DWARFFormValue::getFixedFormSizes() In preparation for a follow on patch that improves DWARF parsing speed, clean up DWARFFormValue so that we have can get the fixed byte size of a form value given a DWARFUnit or given the version, address byte size and dwarf32/64. This patch cleans up code so that everyone is using one of the new DWARFFormValue functions: static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, const DWARFUnit *U = nullptr); static Optional<uint8_t> DWARFFormValue::getFixedByteSize(dwarf::Form Form, uint16_t Version, uint8_t AddrSize, bool Dwarf32); This patch changes DWARFFormValue::skipValue() to rely on the output of DWARFFormValue::getFixedByteSize(...) instead of duplicating the code in each function. This will reduce the number of changes we need to make to DWARF to fewer places in DWARFFormValue when we add support for new form. This patch also starts to support DWARF64 so that we can get correct byte sizes for forms that vary according the DWARF 32/64. To reduce the code duplication a new FormSizeHelper pure virtual class was created that can be created as a FormSizeHelperDWARFUnit when you have a DWARFUnit, or FormSizeHelperManual where you manually specify the DWARF version, address byte size and DWARF32/DWARF64. There is now a single implementation of a function that gets the fixed byte size (instead of two where one took a DWARFUnit and one took the DWARF version, address byte size and DWARFFormat enum) and one function to skip the form values. https://reviews.llvm.org/D26526 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[PowerPC] Add vector conversion builtins to altivec.h - LLVM portionNemanja Ivanovic
This patch corresponds to review: https://reviews.llvm.org/D26307 Adds all the intrinsics used for various conversion builtins that will be added to altivec.h. These are type conversions between various types of vectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286596 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Add missing file from r286566Teresa Johnson
Add the new BitcodeWriter.h header, which was missed in my r286566 commit, and should fix all the bot failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286569 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Split Bitcode/ReaderWriter.h into separate reader and writer headersTeresa Johnson
Summary: Split ReaderWriter.h which contains the APIs into both the BitReader and BitWriter libraries into BitcodeReader.h and BitcodeWriter.h. This is to address Chandler's concern about sharing the same API header between multiple libraries (BitReader and BitWriter). That concern is why we create a single bitcode library in our downstream build of clang, which led to r286297 being reverted as it added a dependency that created a cycle only when there is a single bitcode library (not two as in upstream). Reviewers: mehdi_amini Subscribers: dlj, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D26502 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286566 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini
This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Make the Error class constructor protectedMehdi Amini
This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[ADT/MathExtras] Introduce PowerOf2Ceil.Davide Italiano
To be used in lld (and probably somewhere else in llvm). Differential Revision: https://reviews.llvm.org/D26538 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[llvm] Remove duplicate header from PassInfo.hMandeep Singh Grang
Reviewers: mehdi_amini Differential Revision: https://reviews.llvm.org/D26533 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11ScheduleDAGInstrs: Add condjump deps to addSchedBarrierDeps()Matthias Braun
addSchedBarrierDeps() is supposed to add use operands to the ExitSU node. The current implementation adds uses for calls/barrier instruction and the MBB live-outs in all other cases. The use operands of conditional jump instructions were missed. Also added code to macrofusion to set the latencies between nodes to zero to avoid problems with the fusing nodes lingering around in the pending list now. Differential Revision: https://reviews.llvm.org/D25140 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10Timer: Remove group-less NamedRegionTimer constructor.Matthias Braun
The NamedRegionTimer initializer without a group name puts the Timer into the "Misc" group and is (nearly) unused. Remove it. The only user of this constructor appears to be the HexagonGenInsert pass, which creates a counter without group to count the complete execution time of that pass, however since every pass gets a counter by the PassManager anyway this should be unnecessary. Also removed the pointless TimerGroup there. Differential Revision: https://reviews.llvm.org/D25582 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10[DAG Combiner] Fix the native computation of the Newton series for reciprocalsEvandro Menezes
The generic infrastructure to compute the Newton series for reciprocal and reciprocal square root was conceived to allow a target to compute the series itself. However, the original code did not properly consider this condition if returned by a target. This patch addresses the issues to allow a target to compute the series on its own. Differential revision: https://reviews.llvm.org/D22975 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10GlobalISel: fix mistaken comment changeTim Northover
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10IR: Introduce inrange attribute on getelementptr indices.Peter Collingbourne
If the inrange keyword is present before any index, loading from or storing to any pointer derived from the getelementptr has undefined behavior if the load or store would access memory outside of the bounds of the element selected by the index marked as inrange. This can be used, e.g. for alias analysis or to split globals at element boundaries where beneficial. As previously proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-July/102472.html Differential Revision: https://reviews.llvm.org/D22793 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10RegisterCoalescer: Ignore interferences for constant physregsMatthias Braun
When copying to/from a constant register interferences can be ignored. Also update the documentation for isConstantPhysReg() to make it more obvious that this transformation is valid. Differential Revision: https://reviews.llvm.org/D26106 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10Fix initialization order error.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10[Support] Improve flexibility of binary blob formatter.Zachary Turner
This makes it possible to indent a binary blob by a certain number of bytes, and also makes some things more idiomatic. Finally, it integrates this binary blob formatter into ScopedPrinter which used to have its own implementation of this algorithm. Differential Revision: https://reviews.llvm.org/D26477 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10Fix some Clang-tidy modernize-use-default and ↵Eugene Zelenko
readability-redundant-member-init and Include What You Use warnings; other minor fixes. Differential revision: https://reviews.llvm.org/D26087 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Re-apply r286384, "X86: Introduce the "relocImm" ComplexPattern, which ↵Peter Collingbourne
represents a relocatable immediate.", with a fix for 32-bit x86. Teach X86InstrInfo::analyzeCompare() not to crash on CMP and SUB instructions that take a global address operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Add isHotBB helper function to ProfileSummaryInfoDehao Chen
Summary: This will unify all BB hotness checks. Reviewers: eraman, davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26353 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09GlobalISel: fix typo. NFCTim Northover
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09GlobalISel: translate invoke and landingpad instructionsTim Northover
Pretty bare-bones support for exception handling (no weird MSVC stuff, no SjLj etc), but it should get things going. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Minor unroll pass refacoring.Evgeny Stupachenko
Summary: Unrolled Loop Size calculations moved to a function. Constant representing number of optimized instructions when "back edge" becomes "fall through" replaced with variable. Some comments added. Reviewers: mzolotukhin Differential Revision: http://reviews.llvm.org/D21719 From: Evgeny Stupachenko <evstupac@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09[SCEV] Refactor out a useful pattern; NFCSanjoy Das
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Revert r286384, "X86: Introduce the "relocImm" ComplexPattern, which ↵Peter Collingbourne
represents a relocatable immediate." Suspected to be the cause of a sanitizer-windows bot failure: Assertion failed: isImm() && "Wrong MachineOperand accessor", file C:\b\slave\sanitizer-windows\llvm\include\llvm/CodeGen/MachineOperand.h, line 420 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09X86: Introduce the "relocImm" ComplexPattern, which represents a relocatable ↵Peter Collingbourne
immediate. A relocatable immediate is either an immediate operand or an operand that can be relocated by the linker to an immediate, such as a regular symbol in non-PIC code. Start using relocImm for 32-bit and 64-bit MOV instructions, and for operands of type "imm32_su". Remove a number of now-redundant patterns. Differential Revision: https://reviews.llvm.org/D25812 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Bitcode: Change the materializer interface to return llvm::Error.Peter Collingbourne
Differential Revision: https://reviews.llvm.org/D26439 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Zero-initialize chrono duration objectsPavel Labath
The default duration constructor does not zero-initialize the object, we need to do that manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09[mips] Add non-const getter for the Elf_Mips_Options class. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09Revert "[ThinLTO] Prevent exporting of locals used/defined in module level asm"Mehdi Amini
This reverts commit r286297. Introduces a dependency from libAnalysis to libObject, which I missed during the review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286329 91177308-0d34-0410-b5e6-96231b3b80d8