summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* [IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declareReid Kleckner2017-09-202-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This implements the design discussed on llvm-dev for better tracking of variables that live in memory through optimizations: http://lists.llvm.org/pipermail/llvm-dev/2017-September/117222.html This is tracked as PR34136 llvm.dbg.addr is intended to be produced and used in almost precisely the same way as llvm.dbg.declare is today, with the exception that it is control-dependent. That means that dbg.addr should always have a position in the instruction stream, and it will allow passes that optimize memory operations on local variables to insert llvm.dbg.value calls to reflect deleted stores. See SourceLevelDebugging.rst for more details. The main drawback to generating DBG_VALUE machine instrs is that they usually cause LLVM to emit a location list for DW_AT_location. The next step will be to teach DwarfDebug.cpp how to recognize more DBG_VALUE ranges as not needing a location list, and possibly start setting DW_AT_start_offset for variables whose lifetimes begin mid-scope. Reviewers: aprantl, dblaikie, probinson Subscribers: eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D37768 llvm-svn: 313825
* Allow ORE.emit to take a closure to delay building the remark objectAdam Nemet2017-09-192-12/+9
| | | | | | | | | | | In the lambda we are now returning the remark by value so we need to preserve its type in the insertion operator. This requires making the insertion operator generic. I've also converted a few cases to use the new API. It seems to work pretty well. See the LoopUnroller for a slightly more interesting case. llvm-svn: 313691
* Re-land "Fix Bug 30978 by emitting cv file checksums."Reid Kleckner2017-09-191-0/+2
| | | | | | | This reverts r313431 and brings back r313374 with a fix to write checksums as binary data and not ASCII hex strings. llvm-svn: 313657
* [x86] Lowering Mask Set1 intrinsics to LLVM IRJina Nahias2017-09-191-0/+7
| | | | | | | | This patch, together with a matching clang patch (https://reviews.llvm.org/D37668), implements the lowering of X86 mask set1 intrinsics to IR. Differential Revision: https://reviews.llvm.org/D37669 llvm-svn: 313625
* [X86] Remove VPERM2F128/VPERM2I128 intrinsics and autoupgrade to native ↵Craig Topper2017-09-161-0/+38
| | | | | | | | shuffles. I've moved the test cases from the InstCombine optimizations to the backend to keep the coverage we had there. It covered every possible immediate so I've preserved the resulting shuffle mask for each of those immediates. llvm-svn: 313450
* Revert "Fix Bug 30978 by emitting cv file checksums."Eric Beckmann2017-09-161-2/+0
| | | | | | | | | | | This reverts commit 6389e7aa724ea7671d096f4770f016c3d86b0d54. There is a bug in this implementation where the string value of the checksum is outputted, instead of the actual hex bytes. Therefore the checksum is incorrect, and this prevent pdbs from being loaded by visual studio. Revert this until the checksum is emitted correctly. llvm-svn: 313431
* [AutoUpgrade] Fix a compatibility issue with module flagSteven Wu2017-09-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | Summary: After r304661, module flag to record objective-c image info section is encoded without whitespaces after comma. The new name is equivalent to the old one, except that when LTO a module built by old compiler and a module built by a new compiler, it will fail with conflicting values. Fix the issue by removing whitespaces in bitcode upgrade path. rdar://problem/34416934 Reviewers: compnerd Reviewed By: compnerd Subscribers: mehdi_amini, hans, llvm-commits Differential Revision: https://reviews.llvm.org/D37909 llvm-svn: 313398
* [ConstantFold] Return the correct type when folding a GEP with vector indices.Davide Italiano2017-09-151-1/+12
| | | | | | | | | | | | | | | | As Eli pointed out (and I got wrong in the first place), langref says: "The getelementptr returns a vector of pointers, instead of a single address, when one or more of its arguments is a vector. In such cases, all vector arguments should have the same number of elements, and every scalar argument will be effectively broadcast into a vector during address calculation." Costantfold for gep doesn't really take in account this paragraph, returning a pointer instead of a vector of pointer which triggers an assertion in RAUW, as we're trying to replace values with mistmatching types. Differential Revision: https://reviews.llvm.org/D37928 llvm-svn: 313394
* This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352 Vivek Pandya2017-09-157-82/+133
| | | | | | | | | | | It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with command line options. The diagnostic handler used to be callback now this patch adds a class DiagnosticHandler. It has virtual method to provide custom diagnostic handler and methods to control which particular remarks are enabled. However LLVM-C API users can still provide callback function for diagnostic handler. llvm-svn: 313390
* This reverts r313381Vivek Pandya2017-09-157-133/+82
| | | | llvm-svn: 313387
* This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352 Vivek Pandya2017-09-157-82/+133
| | | | | | | | | | | It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with command line options. The diagnostic handler used to be callback now this patch adds a class DiagnosticHandler. It has virtual method to provide custom diagnostic handler and methods to control which particular remarks are enabled. However LLVM-C API users can still provide callback function for diagnostic handler. llvm-svn: 313382
* Fix Bug 30978 by emitting cv file checksums.Eric Beckmann2017-09-151-0/+2
| | | | | | | | | | | | Summary: The checksums had already been placed in the IR, this patch allows MCCodeView to actually write it out to an MCStreamer. Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37157 llvm-svn: 313374
* [X86] [PATCH] [intrinsics] Lowering X86 ABS intrinsics to IR. (llvm)Uriel Korach2017-09-131-1/+26
| | | | | | | | This patch, together with a matching clang patch (https://reviews.llvm.org/D37694), implements the lowering of X86 ABS intrinsics to IR. differential revision: https://reviews.llvm.org/D37693. llvm-svn: 313134
* IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.Peter Collingbourne2017-09-124-9/+9
| | | | | | | | This allows the flag to be persisted through to LTO. Differential Revision: https://reviews.llvm.org/D37655 llvm-svn: 313078
* [X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IRYael Tsafrir2017-09-121-1/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D37560 llvm-svn: 313013
* Revert "adding autoUpgrade support to broadcast[f|i]32x2 intrinsics"Uriel Korach2017-09-101-20/+1
| | | | | | This reverts commit r312879 - An accidental partial commit. llvm-svn: 312880
* adding autoUpgrade support to broadcast[f|i]32x2 intrinsicsUriel Korach2017-09-101-1/+20
| | | | llvm-svn: 312879
* Revert r312318, r312325, r312424, r312489Richard Trieu2017-09-071-1/+0
| | | | | | | | | | r312318 - Debug info for variables whose type is shrinked to bool r312325, r312424, r312489 - Test case for r312318 Revision 312318 introduced a null dereference bug. Details in https://bugs.llvm.org/show_bug.cgi?id=34490 llvm-svn: 312758
* Move duplicate helpers from DbgValueInst / DbgDeclareInst to DbgInfoIntrinsicReid Kleckner2017-09-071-28/+11
| | | | | | NFC llvm-svn: 312754
* [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-09-062-32/+43
| | | | | | other minor fixes (NFC). llvm-svn: 312679
* Debug info for variables whose type is shrinked to boolStrahinja Petrovic2017-09-011-0/+1
| | | | | | | | | | | | | This patch provides such debug information for integer variables whose type is shrinked to bool by providing dwarf expression which returns either constant initial value or other value. Patch by Nikola Prica. Differential Revision: https://reviews.llvm.org/D35994 llvm-svn: 312318
* [IR] Missing changes for r312289 (NFC).Eugene Zelenko2017-08-311-6/+13
| | | | llvm-svn: 312290
* Revert "Revert r312139 "Verifier: Verify the correctness of fragment ↵Adrian Prantl2017-08-311-8/+22
| | | | | | | | expressions attached to globals."" This reverts commit r312182 after fixing PR34390. llvm-svn: 312197
* Revert r312139 "Verifier: Verify the correctness of fragment expressions ↵Hans Wennborg2017-08-301-22/+8
| | | | | | | | attached to globals." This caused PR34390. llvm-svn: 312182
* [IR] Don't print "!DIExpression() = !DIExpression()" when dumpingReid Kleckner2017-08-301-1/+1
| | | | | | | | | Now that we print DIExpressions inline everywhere, we don't need to print them once as an operand and again as a value. This is only really visible when calling dump() or print() directly on a DIExpression during debugging. llvm-svn: 312168
* Refactor DIBuilder::createFragmentExpression into a static DIExpression memberAdrian Prantl2017-08-302-27/+28
| | | | | | NFC llvm-svn: 312165
* Canonicalize the representation of empty an expression in ↵Adrian Prantl2017-08-301-0/+2
| | | | | | | | | | | | | | | | DIGlobalVariableExpression This change simplifies code that has to deal with DIGlobalVariableExpression and mirrors how we treat DIExpressions in debug info intrinsics. Before this change there were two ways of representing empty expressions on globals, a nullptr and an empty !DIExpression(). If someone needs to upgrade out-of-tree testcases: perl -pi -e 's/(!DIGlobalVariableExpression\(var: ![0-9]*)\)/\1, expr: !DIExpression())/g' <MYTEST.ll> will catch 95%. llvm-svn: 312144
* Verifier: Verify the correctness of fragment expressions attached to globals.Adrian Prantl2017-08-301-8/+22
| | | | llvm-svn: 312139
* [PGO] Fixed non-determinism with DenseSet storing function importing info.Ana Pazos2017-08-291-2/+7
| | | | | | | | | | | | | | | | | | | | Summary: r296498 introduced a DenseSet to store function importing info. Using this container causes a test failure in test/Transform/SampleProfile/import.ll when in Reverse Iteration mode. This patch orders IDs before iterating through this container. Reviewers: danielcdh, mgrang Reviewed By: danielcdh Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37246 llvm-svn: 312012
* [Instruction] add moveAfter() convenience function; NFCISanjay Patel2017-08-291-0/+4
| | | | | | | | | As suggested in D37121, here's a wrapper for removeFromParent() + insertAfter(), but implemented using moveBefore() for symmetry/efficiency. Differential Revision: https://reviews.llvm.org/D37239 llvm-svn: 312001
* [Verifier] Diagnose invalid DIType references instead of crashing.Davide Italiano2017-08-251-0/+1
| | | | | | Fixes PR34325. llvm-svn: 311805
* Normlize to LF line endings.Michael Kruse2017-08-251-2/+2
| | | | | | | Commit r297442 introduced mixed CRLF/LF line endings to two files. Normalize to to LF-only line endings. llvm-svn: 311774
* Add ‘llvm.experimental.constrained.fma‘ Intrinsic.Wei Ding2017-08-242-7/+19
| | | | | | Differential Revision: http://reviews.llvm.org/D36335 llvm-svn: 311629
* Support all integer types in DiagnosticInfoOptimizationBase::ArgumentAdam Nemet2017-08-241-2/+10
| | | | | | We were missing size_t (unsigned long) on macOS. llvm-svn: 311628
* Retire the llvm.dbg.mir hack after r311594.Adrian Prantl2017-08-231-1/+1
| | | | llvm-svn: 311610
* Add a Verifier check for DILocation's scopes.Adrian Prantl2017-08-231-0/+4
| | | | | | Found via https://bugs.llvm.org/show_bug.cgi?id=33997. llvm-svn: 311608
* Parse and print DIExpressions inline to ease IR and MIR testingReid Kleckner2017-08-231-1/+21
| | | | | | | | | | | | | | | | | | | Summary: Most DIExpressions are empty or very simple. When they are complex, they tend to be unique, so checking them inline is reasonable. This also avoids the need for CodeGen passes to append to the llvm.dbg.mir named md node. See also PR22780, for making DIExpression not be an MDNode. Reviewers: aprantl, dexonsmith, dblaikie Subscribers: qcolombet, javed.absar, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D37075 llvm-svn: 311594
* [IR] AutoUpgrade ModuleFlagBehavior for PIC and PIE levelSteven Wu2017-08-211-5/+23
| | | | | | | | | | | | | | | | | | | Summary: From r303590, ModuleFlagBehavior for PIC and PIE level is changed from Error to Max. This will cause bitcode compatibility issue when linking against a bitcode static archive built with old compiler. Add an auto-ugprade path to upgrade the the ModuleFlagBehavior in the old bitcode to match the new one so IRLinker can link them. Reviewers: tejohnson, mehdi_amini, dexonsmith Reviewed By: dexonsmith Subscribers: hans, llvm-commits Differential Revision: https://reviews.llvm.org/D36556 llvm-svn: 311387
* [ORE] Remove Old Optimization Remark APISam Elliott2017-08-211-43/+4
| | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=33789 Reviewers: anemet Reviewed By: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36972 llvm-svn: 311380
* Move helper classes into anonymous namespaces.Benjamin Kramer2017-08-201-0/+2
| | | | | | No functionality change intended. llvm-svn: 311288
* IR: Make stripDebugInfo robust against (invalid) empty basic blocksJustin Bogner2017-08-181-0/+3
| | | | | | | | | | Since stripDebugInfo runs before the verifier when reading IR, we can end up in a situation where we read some invalid IR but don't know its invalid yet. Before this patch we would crash in stripDebugInfo when given IR with a completely empty basic block, and after we get a nice error from the verifier instead. llvm-svn: 311202
* [Verifier] Avoid visiting DIGlobalVariables twice.Davide Italiano2017-08-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | We currently visit them twice. Once, through `visitMDNode()` -> (the code generated by) `../include/llvm/IR/Metadata.def:109` -> `visitDIGlobalVariable()` Then, through `visitMDNode()` -> `visitDIGlobalVariableExpression()` -> `visitDIGlobalVariable()` This results in verification failures printed twice, e.g.: $ ./opt -verify ../../test/DebugInfo/pr34186.ll missing global variable type !4 = distinct !DIGlobalVariable(name: "pat", scope: !0, file: !1, line: 27, isLocal: true, isDefinition: true) missing global variable type !4 = distinct !DIGlobalVariable(name: "pat", scope: !0, file: !1, line: 27, isLocal: true, isDefinition: true) ./opt: ../../test/DebugInfo/pr34186.ll: error: input module is broken! The patch removes one call so we ensure each GV is visited exactly once. Differential Revision: https://reviews.llvm.org/D36797 llvm-svn: 311081
* [Dominators] Introduce batch updatesJakub Kuderski2017-08-161-0/+10
| | | | | | | | | | | | | | | | | Summary: This patch introduces a way of informing the (Post)DominatorTree about multiple CFG updates that happened since the last tree update. This makes performing tree updates much easier, as it internally takes care of applying the updates in lockstep with the (virtual) updates to the CFG, which is done by reverse-applying future CFG updates. The batch updater is able to remove redundant updates that cancel each other out. In the future, it should be also possible to reorder updates to reduce the amount of work needed to perform the updates. Reviewers: dberlin, sanjoy, grosser, davide, brzycki Reviewed By: brzycki Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D36167 llvm-svn: 311015
* [Verifier] Reject globals without a type associated.Davide Italiano2017-08-161-0/+1
| | | | llvm-svn: 311012
* Add strictfp attribute to prevent unwanted optimizations of libm callsAndrew Kaylor2017-08-142-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D34163 llvm-svn: 310885
* [OptDiag] Updating Remarks in SampleProfileEli Friedman2017-08-111-0/+10
| | | | | | | | | | | | | | | | Updating remark API to newer OptimizationDiagnosticInfo API. This allows remarks to show up in diagnostic yaml file, and enables use of opt-viewer tool. Hotness information for remarks (L505 and L751) do not display hotness information, most likely due to profile information not being propagated yet. Unsure if this is the desired outcome. Patch by Tarun Rajendran. Differential Revision: https://reviews.llvm.org/D36127 llvm-svn: 310763
* [AVX512] Remove and autoupgrade many of the broadcast intrinsicsCraig Topper2017-08-111-0/+23
| | | | | | | | | | | | | | | | | Summary: This autoupgrades most of the broadcast intrinsics. They've been unused in clang for some time. This leaves the 32x2 intrinsics because they are still used in clang. Reviewers: RKSimon, zvi, igorb Reviewed By: RKSimon Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36606 llvm-svn: 310725
* Prevent unused warning in non-assert builds (introduced in r310014).Daniel Jasper2017-08-041-2/+2
| | | | llvm-svn: 310022
* Un-revert r310014: false revert, it wasn't the cause of build breakVictor Leschuk2017-08-041-4/+25
| | | | llvm-svn: 310021
* Revert r310014 as it breaks build lld-x86_64-darwin13Victor Leschuk2017-08-041-25/+4
| | | | llvm-svn: 310020
OpenPOWER on IntegriCloud