summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* AMDGPU/SI: Fix a bug in SIFoldOperandsMarek Olsak2016-01-131-0/+11
| | | | | | | | | | | | Summary: ret.ll will contain a test for this Reviewers: tstellarAMD, arsenm Subscribers: arsenm Differential Revision: http://reviews.llvm.org/D16029 llvm-svn: 257590
* LEA code size optimization pass (Part 2): Remove redundant LEA instructions.Andrey Turetskiy2016-01-132-3/+160
| | | | | | | | | | Make x86 OptimizeLEAs pass remove LEA instruction if there is another LEA (in the same basic block) which calculates address differing only be a displacement. Works only for -Oz. Differential Revision: http://reviews.llvm.org/D13295 llvm-svn: 257589
* Remove extra whitespace. NFC.Junmo Park2016-01-131-10/+10
| | | | llvm-svn: 257578
* [SPARC] Revamp AnalyzeBranch and add ReverseBranchCondition.James Y Knight2016-01-132-89/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnalyzeBranch on X86 (and, previously, SPARC, which implementation was copied from X86) tries to modify the branches based on block layout (e.g. checking isLayoutSuccessor), when AllowModify is true. The rest of the architectures leave that up to the caller, which can call InsertBranch, RemoveBranch, and ReverseBranchCondition as appropriate. That appears to be the preferred way to do it nowadays. This commit makes SPARC like the rest: replaces AnalyzeBranch with an implementation cribbed from AArch64, and adds a ReverseBranchCondition implementation. Additionally, a test-case has been added (also cribbed from AArch64) demonstrating that redundant branch sequences no longer get emitted. E.g., it used to emit code like this: bne .LBB1_2 nop ba .LBB1_1 nop .LBB1_2: And now emits: cmp %i0, 42 be .LBB1_1 nop llvm-svn: 257572
* [Coverage] Refactor coverage mapping reader code Xinliang David Li2016-01-131-17/+13
| | | | | | | | | | | | | | (Resubmit after fixing a typo that breaks test on big endian machines) In this refactoring, member functions are introduced to access CovMap header/func record members and hide layout details. This will enable further code restructuring to support reading multiple versions of coverage mapping data with shared/templatized code. (When coveremap format version changes, backward compatibtility should be preserved). llvm-svn: 257571
* Rollback r257551 -- unexpected test failures TBIXinliang David Li2016-01-131-13/+17
| | | | llvm-svn: 257564
* Re-Revert r257105 (Verifier debug info changes)Keno Fischer2016-01-132-64/+16
| | | | | | | While I investigate some new buildbot failures. This was originally reapplied as r257550 and r257558. llvm-svn: 257563
* [libFuzzer] make sure to update CurrentUnit when drillingKostya Serebryany2016-01-131-1/+4
| | | | llvm-svn: 257560
* Use utostr rather than std::to_stringKeno Fischer2016-01-131-2/+2
| | | | | | | Looks like std::to_string is not available for Android. Hopefully this fixes the bot. llvm-svn: 257558
* AsmPrinter: Fix wrong OS X versions being emitted for darwin triplesMatthias Braun2016-01-131-14/+18
| | | | | | | | | | | | The version numbers of the darwin kernel are different from the version numbers of OS X, so we need adjustments if we had "*-*-darwin" triples. Use the existing utility functions in TargetTriple for this. Fixes rdar://22056966 Differential Revision: http://reviews.llvm.org/D14601 llvm-svn: 257555
* [CodeView] Mark our lines as statements, not expressionsDavid Majnemer2016-01-131-3/+18
| | | | | | | | | The line tables for CodeView make a distinction between expressions and statements. As it turns out, MSVC always emits them as statements and we always emit them as expressions. Let's switch to statements to match the CodeView that they emit. llvm-svn: 257553
* [Coverage] Refactor coverage mapping reader code /NFCXinliang David Li2016-01-131-17/+13
| | | | | | | | | | | | | (Resubmit after fixing build bot failures) In this refactoring, member functions are introduced to access CovMap header/func record members and hide layout details. This will enable further code restructuring to support reading multiple versions of coverage mapping data with shared/templatized code. (When coveremap format version changes, backward compatibtility should be preserved). llvm-svn: 257551
* Reapply r257105 "[Verifier] Check that debug values have proper size"Keno Fischer2016-01-132-16/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The follow extra changes were made to test cases: Manually making the variable be the actual type instead of a pointer to avoid pointer-size differences in generic code: LLVM :: DebugInfo/Generic/2010-03-24-MemberFn.ll LLVM :: DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll LLVM :: DebugInfo/Generic/2010-05-03-DisableFramePtr.ll LLVM :: DebugInfo/Generic/varargs.ll Delete sizing information from debug info for the same reason (but the presence of the pointer was important to the test case): LLVM :: DebugInfo/Generic/restrict.ll LLVM :: DebugInfo/Generic/tu-composite.ll LLVM :: Linker/type-unique-type-array-a.ll LLVM :: Linker/type-unique-simple2.ll Fixing an incorrect DW_OP_deref LLVM :: DebugInfo/Generic/2010-05-03-OriginDIE.ll Fixing a missing DW_OP_deref LLVM :: DebugInfo/Generic/incorrect-variable-debugloc.ll Additionally, clang should no longer complain during bootstrap should no longer happen after r257534. The original commit message was: ``` Summary: Teach the Verifier to make sure that the storage size given to llvm.dbg.declare or the value size given to llvm.dbg.value agree with what is declared in DebugInfo. This is implicitly assumed in a number of passes (e.g. in SROA). Additionally this catches a number of common mistakes, such as passing a pointer when a value was intended or vice versa. One complication comes from stack coloring which modifies the original IR when it merges allocas in order to make sure that if AA falls back to the IR it gets the correct result. However, given this new invariant, indiscriminately replacing one alloca by a different (differently sized one) is no longer valid. Fix this by just undefing out any use of the alloca in a dbg.declare in this case. Additionally, I had to fix a number of test cases. Of particular note: - I regenerated dbg-changes-codegen-branch-folding.ll from the given source as it was affected by the bug fixed in r256077 - two-cus-from-same-file.ll was changed to avoid having a variable-typed debug variable as that would depend on the target, even though this test is supposed to be generic - I had to manually declared size/align for reference type. See also the discussion for D14275/r253186. - fpstack-debuginstr-kill.ll required changing `double` to `long double` - most others were just a question of adding OP_deref ``` llvm-svn: 257550
* Rollback r257547 -- buildbot failure TBIXinliang David Li2016-01-131-13/+17
| | | | llvm-svn: 257549
* [Coverage] Refactor coverage mapping reader code /NFCXinliang David Li2016-01-131-17/+13
| | | | | | | | | | | In this refactoring, member functions are introduced to access CovMap header/func record members and hide layout details. This will enable further code restructuring to support reading multiple versions of coverage mapping data with shared/templatized code. (When coveremap format version changes, backward compatibtility should be preserved). llvm-svn: 257547
* Guard fabs to bfc convert with V6T2 flagAna Pazos2016-01-131-2/+2
| | | | | | | | | | | | | | Summary: BFC instructions are available in ARMv6T2 and above. Reviewers: t.p.northover Subscribers: aemerson Differential Revision: http://reviews.llvm.org/D16076 llvm-svn: 257546
* [ARM] Mark VMOV with immediate: isAsCheapAsMove.Quentin Colombet2016-01-131-2/+5
| | | | | | | | | | VMOVs are not strictly speaking cheap, but they are as expensive as a vector copy (VORR), so we should prefer rematerialization over splitting when it applies. rdar://problem/23754176 llvm-svn: 257545
* CannotBeOrderedLessThanZero: add some missing casesFiona Glaser2016-01-121-0/+12
| | | | llvm-svn: 257542
* COFF: Teach llvm-objdump how to dump DLL forwarder symbols.Rui Ueyama2016-01-121-0/+24
| | | | llvm-svn: 257539
* [WebAssembly] Fix disassembler shared-libs buildDerek Schuff2016-01-121-1/+2
| | | | llvm-svn: 257536
* RegisterPressure: Expose RegisterOperands APIMatthias Braun2016-01-122-65/+65
| | | | | | | | | | | | | | | | | | | | | | Previously the RegisterOperands have only been used internally in RegisterPressure.cpp. However this datastructure can be useful for other tasks as well and allows refactoring of PDiff initialisation out of RPTracker::recede(). This patch: - Exposes RegisterOperands as public API - Splits RPTracker::recede() into a part that skips DebugValues and maintains the region borders, and the core that changes register pressure when given a set of RegisterOperands. - This allows to move the PDiff initialisation out recede() into a method of the PressureDiffs class. - The upcoming subregister scheduling code will also use RegisterOperands to avoid pushing more unrelated functionality into recede()/advance(). Differential Revision: http://reviews.llvm.org/D15473 llvm-svn: 257535
* [Utils] Insert DW_OP_bit_piece when only describing part of the variableKeno Fischer2016-01-121-2/+24
| | | | | | | | | | | | | Summary: The dbg.declare -> dbg.value conversion looks through any zext/sext to find a value to describe the variable (in the expectation that those zext/sext instruction will go away later). However, those values do not cover the entire variable and thus need a DW_OP_bit_piece. Reviewers: aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16061 llvm-svn: 257534
* [Support] Add saturating multiply-add support functionNathan Slingerland2016-01-121-14/+3
| | | | | | | | | | | | Summary: Add SaturatingMultiplyAdd convenience function template since A + (X * Y) comes up frequently when doing weighted arithmetic. Reviewers: davidxl, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15385 llvm-svn: 257532
* [CodeView] Initialize column-end to zeroDavid Majnemer2016-01-121-1/+1
| | | | | | | | | | | | | CodeView, unlike DWARF, can associate code with a range of columns. However, LLVM can only represent a single column position internally. We used to claim that the end column and start column were the same which yielded less than satisfactory results: we would stop printing at the _beginning_ of the source expression! Instead, mark the column-end as 'zero' to indicate that we don't have one (as per the documentation for IDiaLineNumber::get_lineNumberEnd). llvm-svn: 257528
* [WebAsssembly] Register the MC register info.Dan Gohman2016-01-121-0/+9
| | | | llvm-svn: 257525
* [AVX512] adding PROLQ and PROLD IntrinsicsMichael Zuckerman2016-01-125-1/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D16048 llvm-svn: 257523
* Codegen: [PPC] Handle weighted comparisons when inserting selects.Kyle Butt2016-01-121-10/+33
| | | | | | | | | | | | | Only non-weighted predicates were handled in PPCInstrInfo::insertSelect. Handle the weighted predicates as well. This latent bug was triggered by r255398, because it added use of the branch-weighted predicates. While here, switch over an enum instead of an int to get the compiler to enforce totality in the future. llvm-svn: 257518
* [WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.Dan Gohman2016-01-123-5/+10
| | | | | | | | | A request has been made to the official registry, but an official value is not yet available. This patch uses a temporary value in order to support development. When an official value is recieved, the value of EM_WEBASSEMBLY will be updated. llvm-svn: 257517
* [WebAssembly] Introduce a WebAssemblyTargetStreamer class.Dan Gohman2016-01-129-64/+225
| | | | | | | Refactor .param, .result, .local, and .endfunc, as directives, using the proper MCTargetStreamer mechanism, rather than fake instructions. llvm-svn: 257511
* Replace inherited constructor with an explicit oneKrzysztof Parzyszek2016-01-121-2/+2
| | | | | | Some bots failed when the inherited constructor was used. llvm-svn: 257508
* [WebAssembly] Make CFG stackification independent of basic-block labels.Dan Gohman2016-01-128-82/+161
| | | | | | | | | | | | | | | | | | | | | | | This patch changes the way labels are referenced. Instead of referencing the basic-block label name (eg. .LBB0_0), instructions now just have an immediate which indicates the depth in the control-flow stack to find a label to jump to. This makes them much closer to what we expect to have in the binary encoding, and avoids the problem of basic-block label names not being explicit in the binary encoding. Also, it terminates blocks and loops with end_block and end_loop instructions, rather than basic-block label names, for similar reasons. This will also fix problems where two constructs appear to have the same label, because we no longer explicitly use labels, so consumers that need labels will presumably create their own labels, and presumably they won't reuse labels when they do. This patch does make the code a little more awkward to read; as a partial mitigation, this patch also introduces comments showing where the labels are, and comments on each branch showing where it's branching to. llvm-svn: 257505
* [Hexagon] Implement RDF-based post-RA optimizationsKrzysztof Parzyszek2016-01-125-2/+372
| | | | | | | | - Handle simple cases of register copies (what current RDF CP allows). - Hexagon-specific dead code elimination: handles dead address updates in post-increment instructions. llvm-svn: 257504
* [LibCallSimplifier] use instruction-level fast-math-flags to transform ↵Sanjay Patel2016-01-121-1/+4
| | | | | | | | pow(x, 0.5) calls Also, propagate the FMF to the newly created sqrt() call. llvm-svn: 257503
* rangify; NFCISanjay Patel2016-01-121-12/+10
| | | | llvm-svn: 257500
* Auto-link with ole32.dll to simplify building LLVM.dllReid Kleckner2016-01-121-0/+1
| | | | | | Patch by Jakob Bornecrantz llvm-svn: 257499
* function names start with a lower case letter ; NFCSanjay Patel2016-01-125-14/+14
| | | | llvm-svn: 257496
* [ThinLTO] Handle an external call from an import to an alias in destTeresa Johnson2016-01-121-0/+2
| | | | | | | | | The findExternalCalls routine ignores calls to functions already defined in the dest module. This was not handling the case where the definition in the current module is actually an alias to a function call. llvm-svn: 257493
* [LibCallSimplifier] use instruction-level fast-math-flags to transform ↵Sanjay Patel2016-01-121-17/+14
| | | | | | | | | | | | | | pow(exp(x)) calls See also: http://reviews.llvm.org/rL255555 http://reviews.llvm.org/rL256871 http://reviews.llvm.org/rL256964 http://reviews.llvm.org/rL257400 http://reviews.llvm.org/rL257404 http://reviews.llvm.org/rL257414 llvm-svn: 257491
* RDF: Copy propagationKrzysztof Parzyszek2016-01-123-0/+229
| | | | | | | | | | This is a very limited implementation of DFG-based copy propagation. It only handles actual COPY instructions (does not handle other equivalents such as add-immediate with a 0 operand). The major limitation is that it does not update the DFG: that will be the change required to make it more robust (hopefully coming up soon). llvm-svn: 257490
* AMDGPU: Emit note directive for HSA even if there are no functionsTom Stellard2016-01-122-7/+21
| | | | | | | | | | Reviewers: arsenm, echristo Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D16010 llvm-svn: 257488
* RDF: Dead code eliminationKrzysztof Parzyszek2016-01-123-0/+270
| | | | | | Utility class to perform DFG-based dead code elimination. llvm-svn: 257485
* Fix compiler warnings from r257477Krzysztof Parzyszek2016-01-121-2/+2
| | | | llvm-svn: 257483
* [libFuzzer] add a macro LLVM_FUZZER_DEFINES_SANITIZER_WEAK_HOOOKSKostya Serebryany2016-01-121-0/+8
| | | | llvm-svn: 257482
* RDF: Implement register liveness analysisKrzysztof Parzyszek2016-01-123-0/+955
| | | | | | Compute block live-ins and operand kill flags from the DFG. llvm-svn: 257480
* [mips] Correct operand order in DSP's mthi/mtloDaniel Sanders2016-01-121-2/+3
| | | | | | | | | | | | Summary: The result register is the second operand as per the other mt* instructions. Reviewers: vkalintiris Subscribers: llvm-commits, dsanders Differential Revision: http://reviews.llvm.org/D15993 llvm-svn: 257478
* Register Data Flow: data flow graphKrzysztof Parzyszek2016-01-123-0/+2558
| | | | | | | | | Target independent, SSA-based data flow framework for representing data flow between physical registers. This commit implements the creation of the actual data flow graph. llvm-svn: 257477
* [Hexagon] Make helper function static. NFC.Benjamin Kramer2016-01-121-3/+3
| | | | llvm-svn: 257476
* [ARM] Fix several state persistence bugsKeno Fischer2016-01-122-4/+27
| | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes three bugs, in all of which state is not or incorrecly reset between objects (i.e. when reusing the same pass manager to create multiple object files): 1) AttributeSection needs to be reset to nullptr, because otherwise the backend will try to emit into the old object file's attribute section causing a segmentation fault. 2) MappingSymbolCounter needs to be reset, otherwise the second object file will start where the first one left off. 3) The MCStreamer base class resets the Streamer's e_flags settings. Since EF_ARM_EABI_VER5 is set on streamer creation, we need to set it again after the MCStreamer was rest. Also rename Reset (uppser case) to EHReset to avoid confusion with reset (lower case). Reviewers: rengolin Differential Revision: http://reviews.llvm.org/D15950 llvm-svn: 257473
* Test commit access - tiny comment and code style fix.Andrey Turetskiy2016-01-121-2/+2
| | | | llvm-svn: 257472
* The isel pattern that selects the memory-register form of VCVTPH2PSRobert Lougher2016-01-121-0/+3
| | | | | | | | | | | | | | | (64 to 128-bit) matches against the pattern fragment 'vzmovl_v2i64' (a zero-extended 64-bit load). However, a change in r248784 teaches the instruction combiner that only the lower 64 bits of the input to a 128-bit vcvtph2ps are used. This means the instruction combiner will ordinarily optimize away the upper 64-bit insertelement instruction in the zero-extension and so we no longer select the memory-register form. To fix this a new pattern has been added. Differential Revision: http://reviews.llvm.org/D16067 llvm-svn: 257470
OpenPOWER on IntegriCloud