summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
...
* [C API] PR19859: Add LLVMGetFCmpPredicate and LLVMConstRealGetDouble.Peter Zotov2014-10-281-1/+31
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com>. llvm-svn: 220814
* Silencing an "enumeral and non-enumeral type in conditional expression" ↵Aaron Ballman2014-10-281-1/+2
| | | | | | warning; NFC. llvm-svn: 220775
* X86: Implement the vectorcall calling conventionReid Kleckner2014-10-282-34/+48
| | | | | | | | | | | | | | | | | | | | This is a Microsoft calling convention that supports both x86 and x86_64 subtargets. It passes vector and floating point arguments in XMM0-XMM5, and passes them indirectly once they are consumed. Homogenous vector aggregates of up to four elements can be passed in sequential vector registers, but this part is not implemented in LLVM and will be handled in Clang. On 32-bit x86, it is similar to fastcall in that it uses ecx:edx as integer register parameters and is callee cleanup. On x86_64, it delegates to the normal win64 calling convention. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D5943 llvm-svn: 220745
* Modernize the error handling of the Materialize function.Rafael Espindola2014-10-243-14/+8
| | | | llvm-svn: 220600
* Don't ever call materializeAllPermanently during LTO.Rafael Espindola2014-10-244-10/+29
| | | | | | | | | | To do this, change the representation of lazy loaded functions. The previous representation cannot differentiate between a function whose body has been removed and one whose body hasn't been read from the .bc file. That means that in order to drop a function, the entire body had to be read. llvm-svn: 220580
* Make getDISubprogram(const Function *F) available in LLVMTimur Iskhodzhanov2014-10-231-0/+18
| | | | | | Reviewed at http://reviews.llvm.org/D5950 llvm-svn: 220536
* Revert "Don't count inreg params when mangling fastcall functions"Reid Kleckner2014-10-231-3/+0
| | | | | | | | | | This reverts commit r214981. I'm not sure what I was thinking when I wrote this. Testing with MSVC shows that this function is mangled to '@f@8': int __fastcall f(int a, int b); llvm-svn: 220492
* clang-format two code snippets to make the next patch easy to read.Rafael Espindola2014-10-231-4/+4
| | | | llvm-svn: 220484
* Assert that ValueHandleBase::ValueIsRAUWd doesn't change the tracked Value type.Frederic Riss2014-10-231-0/+2
| | | | | | | | | | | This invariant is enforced in Value::replaceAllUsesWith, thus it seems logical to apply it also to ValueHandles. This commit fixes InstCombine to not trigger the assertion during the removal of constant bitcasts in call instructions. Differential Revision: http://reviews.llvm.org/D5828 llvm-svn: 220468
* Revert "Teach the load analysis to allow finding available values which ↵Hans Wennborg2014-10-211-23/+0
| | | | | | | | require" (r220277) This seems to have caused PR21330. llvm-svn: 220349
* Extend the verifier to check usage of 'nonnull' metadata.Philip Reames2014-10-211-0/+8
| | | | | | The recently added !nonnull metadata is only valid on loads of pointer type. llvm-svn: 220323
* Teach the load analysis to allow finding available values which requireChandler Carruth2014-10-211-0/+23
| | | | | | | | | | | | | | | | | | | | inttoptr or ptrtoint cast provided there is datalayout available. Eventually, the datalayout can just be required but in practice it will always be there today. To go with the ability to expose available values requiring a ptrtoint or inttoptr cast, helpers are added to perform one of these three casts. These smarts are necessary to finish canonicalizing loads and stores to the operational type requirements without regressing fundamental combines. I've added some test cases. These should actually improve as the load combining and store combining improves, but they may fundamentally be highlighting some missing combines for select in addition to exercising the specific added logic to load analysis. llvm-svn: 220277
* Introduce enum values for previously defined metadata types. (NFC)Philip Reames2014-10-211-0/+17
| | | | | | | | | | | Our metadata scheme lazily assigns IDs to string metadata, but we have a mechanism to preassign them as well. Using a preassigned ID is helpful since we get compile time type checking, and avoid some (minimal) string construction and comparison. This change adds enum value for three existing metadata types: + MD_nontemporal = 9, // "nontemporal" + MD_mem_parallel_loop_access = 10, // "llvm.mem.parallel_loop_access" + MD_nonnull = 11 // "nonnull" I went through an updated various uses as well. I made no attempt to get all uses; I focused on the ones which were easily grepable and easily to translate. For example, there were several items in LoopInfo.cpp I chose not to update. llvm-svn: 220248
* Extend the verifier to validate range metadata on calls and invokes.Philip Reames2014-10-201-49/+56
| | | | | | Range metadata applies to loads, call, and invokes. We were validating that metadata applied to loads was correct according to the LangRef, but we were not validating metadata applied to calls or invokes. This change extracts the checking functionality to a common location, reuses it for all valid locations, and adds a simple test to ensure a misused range on a call gets reported. llvm-svn: 220246
* Moved out IIT_V64 from common values section.Robert Khasanov2014-10-201-5/+5
| | | | | | Thanks Juergen Ributzka for notice. llvm-svn: 220224
* Fix Intrinsic::getType not working with varargSteven Wu2014-10-201-0/+6
| | | | | | | | VarArg Intrinsic functions are encoded with "void" type as the last argument. Now Intrinsic::getType can correctly return all the intrinsic function type. llvm-svn: 220205
* Switch the default DataLayout to be little endian, and make the variableChandler Carruth2014-10-201-5/+5
| | | | | | | | | be BigEndian so the default can continue to be zero-initialized. This is one of the prerequisites to making DataLayout a constant and always available part of every module. llvm-svn: 220193
* IR: Replace DataLayout::RoundUpAlignment with RoundUpToAlignmentDavid Majnemer2014-10-201-2/+2
| | | | | | No functional change intended, just cleaning up some code. llvm-svn: 220187
* [Stackmaps] Enable invoking the patchpoint intrinsic.Juergen Ributzka2014-10-171-3/+7
| | | | | | | | | | | Patch by Kevin Modzelewski Reviewers: atrick, ributzka Reviewed By: ributzka Subscribers: llvm-commits, reames Differential Revision: http://reviews.llvm.org/D5634 llvm-svn: 220055
* [LLVM-C] Add LLVMInstructionClone.Peter Zotov2014-10-171-0/+6
| | | | llvm-svn: 220007
* Add CreateAlignmentAssumption to IRBuilderHal Finkel2014-10-151-0/+11
| | | | | | | | | | Clang CodeGen had a utility function for creating pointer alignment assumptions using the @llvm.assume intrinsic. This functionality will also be needed by the inliner (to preserve function-argument alignment attributes when inlining), so this moves the utility function into IRBuilder where it can be used both by Clang CodeGen and also other LLVM-level code. llvm-svn: 219875
* IR: Move NumOperands from User to Value, NFCDuncan P. N. Exon Smith2014-10-151-1/+2
| | | | | | | | | | | | | | | | | | Store `User::NumOperands` (and `MDNode::NumOperands`) in `Value`. On 64-bit host architectures, this reduces `sizeof(User)` and all subclasses by 8, and has no effect on `sizeof(Value)` (or, incidentally, on `sizeof(MDNode)`). On 32-bit host architectures, this increases `sizeof(Value)` by 4. However, it has no effect on `sizeof(User)` and `sizeof(MDNode)`, so the only concrete subclasses of `Value` that actually see the increase are `BasicBlock`, `Argument`, `InlineAsm`, and `MDString`. Moreover, I'll be shocked and confused if this causes a tangible memory regression. This has no functionality change (other than memory footprint). llvm-svn: 219845
* IR: Cleanup comments for Value, User, and MDNodeDuncan P. N. Exon Smith2014-10-153-43/+8
| | | | | | | | | | | | | A follow-up commit will modify the memory-layout of `Value`, `User`, and `MDNode`. First fix the comments to be doxygen-friendly (and to follow the coding standards). - Use "\brief" instead of "repeatedName -". - Add a brief intro where it was missing. - Remove duplicated comments from source files (and a couple of noisy/trivial comments altogether). llvm-svn: 219844
* DI: Make comments "brief"-er, NFCDuncan P. N. Exon Smith2014-10-151-8/+8
| | | | | | | | | | | Follow-up to r219801. Post-commit review pointed out that all comments require a `\brief` description [1], so I converted many and recrafted a few to be briefer or to include a brief intro. (If I'm going to clean them up, I should do it right!) [1]: http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments llvm-svn: 219808
* DI: Cleanup comments, NFCDuncan P. N. Exon Smith2014-10-151-98/+0
| | | | | | | | | | | | | | | | | A number of comment cleanups: - Remove duplicated function and class names from comments. - Remove duplicated comments from source file (some of which were out-of-sync). - Move any unduplicated comments from source file to header. - Remove some noisy comments entirely (e.g., a comment for `DIDescriptor::print()` saying "print descriptor" just gets in the way of reading the code). llvm-svn: 219801
* DI: Use a `DenseMap` instead of named metadata, NFCDuncan P. N. Exon Smith2014-10-152-49/+5
| | | | | | | Remove a strange round-trip through named metadata to assign preserved local variables to their subprograms. llvm-svn: 219798
* DebugInfo: Ensure that all debug location scope chains from instructions ↵David Blaikie2014-10-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | within a function, lead to the function itself. Let me tell you a tale... Originally committed in r211723 after discovering a nasty case of weird scoping due to inlining, this was reverted in r211724 after it fired in ASan/compiler-rt. (minor diversion where I accidentally committed/reverted again in r211871/r211873) After further testing and fixing bugs in ArgumentPromotion (r211872) and Inlining (r212065) it was recommitted in r212085. Reverted in r212089 after the sanitizer buildbots still showed problems. Fixed another bug in ArgumentPromotion (r212128) found by this assertion. Recommitted in r212205, reverted in r212226 after it crashed some more on sanitizer buildbots. Fix clang some more in r212761. Recommitted in r212776, reverted in r212793. ASan failures. Recommitted in r213391, reverted in r213432, trying to reproduce flakey ASan build failure. Fixed bugs in r213805 (ArgPromo + DebugInfo), r213952 (LiveDebugVariables strips dbg_value intrinsics in functions not described by debug info). Recommitted in r214761, reverted in r214999, flakey failure on Windows buildbot. Fixed DeadArgElimination + DebugInfo bug in r219210. Recommitted in r219215, reverted in r219512, failure on ObjC++ atomic properties in the test-suite on Darwin. Fixed ObjC++ atomic properties issue in Clang in r219690. [This commit is provided 'as is' with no hope that this is the last time I commit this change either expressed or implied] llvm-svn: 219702
* Revert "Fix stuff... again."David Blaikie2014-10-141-28/+0
| | | | | | | | Accidental commit. This reverts commit r219693. llvm-svn: 219695
* Fix stuff... again.David Blaikie2014-10-141-0/+28
| | | | llvm-svn: 219693
* Return undef on FP <-> Int conversions that overflow (PR21330).Sanjay Patel2014-10-101-5/+14
| | | | | | | | | | | | | | | | | | | | The LLVM Lang Ref states for signed/unsigned int to float conversions: "If the value cannot fit in the floating point value, the results are undefined." And for FP to signed/unsigned int: "If the value cannot fit in ty2, the results are undefined." This matches the C definitions. The existing behavior pins to infinity or a max int value, but that may just lead to more confusion as seen in: http://llvm.org/bugs/show_bug.cgi?id=21130 Returning undef will hopefully lead to a less silent failure. Differential Revision: http://reviews.llvm.org/D5603 llvm-svn: 219542
* Revert "DebugInfo: Ensure that all debug location scope chains from ↵David Blaikie2014-10-101-28/+0
| | | | | | | | | | | instructions within a function, lead to the function itself." This invariant is violated (& the assertions fire) on some Objective C++ in the test-suite. Reverting while I investigate. This reverts commit r219215. llvm-svn: 219523
* DebugInfo: Ensure that all debug location scope chains from instructions ↵David Blaikie2014-10-071-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | within a function, lead to the function itself. Let me tell you a tale... Originally committed in r211723 after discovering a nasty case of weird scoping due to inlining, this was reverted in r211724 after it fired in ASan/compiler-rt. (minor diversion where I accidentally committed/reverted again in r211871/r211873) After further testing and fixing bugs in ArgumentPromotion (r211872) and Inlining (r212065) it was recommitted in r212085. Reverted in r212089 after the sanitizer buildbots still showed problems. Fixed another bug in ArgumentPromotion (r212128) found by this assertion. Recommitted in r212205, reverted in r212226 after it crashed some more on sanitizer buildbots. Fix clang some more in r212761. Recommitted in r212776, reverted in r212793. ASan failures. Recommitted in r213391, reverted in r213432, trying to reproduce flakey ASan build failure. Fixed bugs in r213805 (ArgPromo + DebugInfo), r213952 (LiveDebugVariables strips dbg_value intrinsics in functions not described by debug info). Recommitted in r214761, reverted in r214999, flakey failure on Windows buildbot. Fixed DeadArgElimination + DebugInfo bug in r219210. Recommitting and hoping that's the last of it. [That one burned down, fell over, then sank into the swamp.] llvm-svn: 219215
* [PM] Remove an unused and rather expensive mapping from an analysisChandler Carruth2014-10-061-4/+0
| | | | | | | | group's interface to all of the implementations of that analysis group. The groups themselves can and do manage this anyways, the pass registry needn't involve itself. llvm-svn: 219097
* [PM] Remove the (deeply misguided) 'unregister' functionality from theChandler Carruth2014-10-061-10/+0
| | | | | | | | | | | | pass registry. This style of registry is somewhat questionable, but it being non-monotonic is crazy. No one is (or should be) unloading DSOs with passes and unregistering them here. I've checked with a few folks and I don't know of anyone using this functionality or any important use case where it is necessary. llvm-svn: 219096
* [cleanup] Switch to using range-based for loops in two very obviousChandler Carruth2014-10-061-6/+4
| | | | | | places. llvm-svn: 219095
* [cleanup] Fix up trailing whitespace and formatting in the pass regitsryChandler Carruth2014-10-051-21/+21
| | | | | | code prior to hacking on it more significantly. llvm-svn: 219094
* Revert "Revert "DI: Fold constant arguments into a single MDString""Duncan P. N. Exon Smith2014-10-034-592/+534
| | | | | | | | | | | | | | | | | | | | | | This reverts commit r218918, effectively reapplying r218914 after fixing an Ocaml bindings test and an Asan crash. The root cause of the latter was a tightened-up check in `DILexicalBlock::Verify()`, so I'll file a PR to investigate who requires the loose check (and why). Original commit message follows. -- This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 219010
* Revert "DI: Fold constant arguments into a single MDString"Duncan P. N. Exon Smith2014-10-024-515/+592
| | | | | | This reverts commit r218914 while I investigate some bots. llvm-svn: 218918
* DI: Fold constant arguments into a single MDStringDuncan P. N. Exon Smith2014-10-024-592/+515
| | | | | | | | | | | | | This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 218914
* Remove an extra whitespace.Adrian Prantl2014-10-021-1/+1
| | | | llvm-svn: 218886
* Pretty-printer: Paper over an ambiguity between line table entriesAdrian Prantl2014-10-021-1/+3
| | | | | | | | and tagged mdnodes. fixes http://llvm.org/bugs/show_bug.cgi?id=21131 llvm-svn: 218885
* DIBuilder: Remove duplicated comments, NFCDuncan P. N. Exon Smith2014-10-011-77/+1
| | | | | | | These comments already appear in the header, and some of them are out-of-date anyway. llvm-svn: 218829
* Revert "DIBuilder: Remove dead code"Duncan P. N. Exon Smith2014-10-011-0/+6
| | | | | | | | | This reverts commit r218820. It turns out that Adrian has an outstanding SROA patch that uses this. I've updated it to forward to `createExpression()`. llvm-svn: 218828
* DIBuilder: Remove dead codeDuncan P. N. Exon Smith2014-10-011-14/+0
| | | | | | | | | | | | I neglected to update `DIBuilder::createPieceExpression()` in r218797, which I noticed while rebasing a patch for PR17891. On closer inspection, it looks like dead code. If there are any downstream users of this, you should transition to the more general `createExpression()`. Or, we can add this back, but then it should just forward to `createExpression()`. llvm-svn: 218820
* DIBuilder: Encapsulate DIExpression's element typeDuncan P. N. Exon Smith2014-10-011-2/+6
| | | | | | | | `DIExpression`'s elements are 64-bit integers that are stored as `ConstantInt`. The accessors already encapsulate the storage. This commit updates the `DIBuilder` API to also encapsulate that. llvm-svn: 218797
* Move the complex address expression out of DIVariable and into an extraAdrian Prantl2014-10-013-91/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument of the llvm.dbg.declare/llvm.dbg.value intrinsics. Previously, DIVariable was a variable-length field that has an optional reference to a Metadata array consisting of a variable number of complex address expressions. In the case of OpPiece expressions this is wasting a lot of storage in IR, because when an aggregate type is, e.g., SROA'd into all of its n individual members, the IR will contain n copies of the DIVariable, all alike, only differing in the complex address reference at the end. By making the complex address into an extra argument of the dbg.value/dbg.declare intrinsics, all of the pieces can reference the same variable and the complex address expressions can be uniqued across the CU, too. Down the road, this will allow us to move other flags, such as "indirection" out of the DIVariable, too. The new intrinsics look like this: declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr) declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr) This patch adds a new LLVM-local tag to DIExpressions, so we can detect and pretty-print DIExpression metadata nodes. What this patch doesn't do: This patch does not touch the "Indirect" field in DIVariable; but moving that into the expression would be a natural next step. http://reviews.llvm.org/D4919 rdar://problem/17994491 Thanks to dblaikie and dexonsmith for reviewing this patch! Note: I accidentally committed a bogus older version of this patch previously. llvm-svn: 218787
* LTO: Ignore disabled diagnostic remarksDuncan P. N. Exon Smith2014-10-013-11/+22
| | | | | | | | | | | | | | | | | | | | | | | r206400 and r209442 added remarks that are disabled by default. However, if a diagnostic handler is registered, the remarks are sent unfiltered to the handler. This is the right behaviour for clang, since it has its own filters. However, the diagnostic handler exposed in the LTO API receives only the severity and message. It doesn't have the information to filter by pass name. For LTO, disabled remarks should be filtered by the producer. I've changed `LLVMContext::setDiagnosticHandler()` to take a `bool` argument indicating whether to respect the built-in filters. This defaults to `false`, so other consumers don't have a behaviour change, but `LTOCodeGenerator::setDiagnosticHandler()` sets it to `true`. To make this behaviour testable, I added a `-use-diagnostic-handler` command-line option to `llvm-lto`. This fixes PR21108. llvm-svn: 218784
* Revert r218778 while investigating buldbot breakage.Adrian Prantl2014-10-013-136/+91
| | | | | | "Move the complex address expression out of DIVariable and into an extra" llvm-svn: 218782
* Move the complex address expression out of DIVariable and into an extraAdrian Prantl2014-10-013-91/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument of the llvm.dbg.declare/llvm.dbg.value intrinsics. Previously, DIVariable was a variable-length field that has an optional reference to a Metadata array consisting of a variable number of complex address expressions. In the case of OpPiece expressions this is wasting a lot of storage in IR, because when an aggregate type is, e.g., SROA'd into all of its n individual members, the IR will contain n copies of the DIVariable, all alike, only differing in the complex address reference at the end. By making the complex address into an extra argument of the dbg.value/dbg.declare intrinsics, all of the pieces can reference the same variable and the complex address expressions can be uniqued across the CU, too. Down the road, this will allow us to move other flags, such as "indirection" out of the DIVariable, too. The new intrinsics look like this: declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr) declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr) This patch adds a new LLVM-local tag to DIExpressions, so we can detect and pretty-print DIExpression metadata nodes. What this patch doesn't do: This patch does not touch the "Indirect" field in DIVariable; but moving that into the expression would be a natural next step. http://reviews.llvm.org/D4919 rdar://problem/17994491 Thanks to dblaikie and dexonsmith for reviewing this patch! llvm-svn: 218778
* [AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW.Robert Khasanov2014-09-301-18/+23
| | | | | | Added new operand type for intrinsics (IIT_V64) llvm-svn: 218668
OpenPOWER on IntegriCloud