Skip to content
  1. Dec 10, 2017
  2. Dec 09, 2017
  3. Dec 08, 2017
    • Adrian Prantl's avatar
      Generalize llvm::replaceDbgDeclare and actually support the use-case that · d1317017
      Adrian Prantl authored
      is mentioned in the documentation (inserting a deref before the plus_uconst).
      
      llvm-svn: 320203
      d1317017
    • Florian Hahn's avatar
      [CodeExtractor] Add debug locations for new call and branch instrs. · e5089e2e
      Florian Hahn authored
      Summary:
      If a partially inlined function has debug info, we have to add debug
      locations to the call instruction calling the outlined function.
      We use the debug location of the first instruction in the outlined
      function, as the introduced call transfers control to this statement and
      there is no other equivalent line in the source code.
      
      We also use the same debug location for the branch instruction added
      to jump from artificial entry block for the outlined function, which just
      jumps to the first actual basic block of the outlined function.
      
      Reviewers: davide, aprantl, rriddle, dblaikie, danielcdh, wmi
      
      Reviewed By: aprantl, rriddle, danielcdh
      
      Subscribers: eraman, JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40413
      
      llvm-svn: 320199
      e5089e2e
  4. Dec 06, 2017
  5. Dec 05, 2017
    • Mikael Holmen's avatar
      Bail out of a SimplifyCFG switch table opt at undef values. · 0a3e9806
      Mikael Holmen authored
      Summary:
      A true or false result is expected from a comparison, but it seems the possibility of undef was overlooked, which could lead to a failed assert. This is fixed by this patch by bailing out if we encounter undef.
      
      The bug is old and the assert has been there since the end of 2014, so it seems this is unusual enough to forego optimization.
      
      Patch by JesperAntonsson.
      
      Reviewers: spatel, eeckstein, hans
      
      Reviewed By: hans
      
      Subscribers: uabelho, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40639
      
      llvm-svn: 319768
      0a3e9806
  6. Dec 04, 2017
  7. Dec 01, 2017
    • Philip Reames's avatar
      [IndVars] Fix a bug introduced in r317012 · 6260cf71
      Philip Reames authored
      Turns out we can have comparisons which are indirect users of the induction variable that we can make invariant.  In this case, there is no loop invariant value contributing and we'd fail an assert.
      
      The test case was found by a java fuzzer and reduced.  It's a real cornercase.  You have to have a static loop which we've already proven only executes once, but haven't broken the backedge on, and an inner phi whose result can be constant folded by SCEV using exit count reasoning but not proven by isKnownPredicate.  To my knowledge, only the fuzzer has hit this case.
      
      llvm-svn: 319583
      6260cf71
    • Mikael Holmen's avatar
      Revert r319537: Bail out of a SimplifyCFG switch table opt at undef values. · 9c13c8b6
      Mikael Holmen authored
      Broke build bots so reverting.
      
      llvm-svn: 319539
      9c13c8b6
    • Mikael Holmen's avatar
      Bail out of a SimplifyCFG switch table opt at undef values. · 9f047795
      Mikael Holmen authored
      Summary:
      A true or false result is expected from a comparison, but it seems the possibility of undef was overlooked, which could lead to a failed assert. This is fixed by this patch by bailing out if we encounter undef.
      
      The bug is old and the assert has been there since the end of 2014, so it seems this is unusual enough to forego optimization.
      
      Patch by: JesperAntonsson
      
      Reviewers: spatel, eeckstein, hans
      
      Reviewed By: hans
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40639
      
      llvm-svn: 319537
      9f047795
    • Zachary Turner's avatar
      Mark all library options as hidden. · 8065f0b9
      Zachary Turner authored
      These command line options are not intended for public use, and often
      don't even make sense in the context of a particular tool anyway. About
      90% of them are already hidden, but when people add new options they
      forget to hide them, so if you were to make a brand new tool today, link
      against one of LLVM's libraries, and run tool -help you would get a
      bunch of junk that doesn't make sense for the tool you're writing.
      
      This patch hides these options. The real solution is to not have
      libraries defining command line options, but that's a much larger effort
      and not something I'm prepared to take on.
      
      Differential Revision: https://reviews.llvm.org/D40674
      
      llvm-svn: 319505
      8065f0b9
  8. Nov 28, 2017
  9. Nov 27, 2017
  10. Nov 21, 2017
  11. Nov 19, 2017
  12. Nov 18, 2017
  13. Nov 17, 2017
  14. Nov 15, 2017
  15. Nov 14, 2017
    • Reid Kleckner's avatar
      Make salvageDebugInfo of casts work for dbg.declare and dbg.addr · 29a5c03c
      Reid Kleckner authored
      Summary:
      Instcombine (and probably other passes) sometimes want to change the
      type of an alloca. To do this, they generally create a new alloca with
      the desired type, create a bitcast to make the new pointer type match
      the old pointer type, replace all uses with the cast, and then simplify
      the casts. We already knew how to salvage dbg.value instructions when
      removing casts, but we can extend it to cover dbg.addr and dbg.declare.
      
      Fixes a debug info quality issue uncovered in Chromium in
      http://crbug.com/784609
      
      Reviewers: aprantl, vsk
      
      Subscribers: hiraditya, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40042
      
      llvm-svn: 318203
      29a5c03c
    • Hans Wennborg's avatar
      Rename CountingFunctionInserter and use for both mcount and cygprofile calls,... · e1ecd61b
      Hans Wennborg authored
      Rename CountingFunctionInserter and use for both mcount and cygprofile calls, before and after inlining
      
      Clang implements the -finstrument-functions flag inherited from GCC, which
      inserts calls to __cyg_profile_func_{enter,exit} on function entry and exit.
      
      This is useful for getting a trace of how the functions in a program are
      executed. Normally, the calls remain even if a function is inlined into another
      function, but it is useful to be able to turn this off for users who are
      interested in a lower-level trace, i.e. one that reflects what functions are
      called post-inlining. (We use this to generate link order files for Chromium.)
      
      LLVM already has a pass for inserting similar instrumentation calls to
      mcount(), which it does after inlining. This patch renames and extends that
      pass to handle calls both to mcount and the cygprofile functions, before and/or
      after inlining as controlled by function attributes.
      
      Differential Revision: https://reviews.llvm.org/D39287
      
      llvm-svn: 318195
      e1ecd61b
    • Mandeep Singh Grang's avatar
      [PredicateInfo] Stable sort ValueDFS to remove non-deterministic ordering · b8a11bbc
      Mandeep Singh Grang authored
      Summary: This fixes failure in Transforms/Util/PredicateInfo/testandor.ll uncovered by D39245.
      
      Reviewers: dberlin
      
      Reviewed By: dberlin
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D39630
      
      llvm-svn: 318165
      b8a11bbc
  16. Nov 13, 2017
    • Florian Hahn's avatar
      [CodeExtractor] Add missing AllowVarArgs initialization. · 71147559
      Florian Hahn authored
      llvm-svn: 318029
      71147559
    • Florian Hahn's avatar
      [PartialInliner] Inline vararg functions that forward varargs. · 0e9dec67
      Florian Hahn authored
      Summary:
      This patch extends the partial inliner to support inlining parts of
      vararg functions, if the vararg handling is done in the outlined part.
      
      It adds a `ForwardVarArgsTo` argument to InlineFunction. If it is
      non-null, all varargs passed to the inlined function will be added to
      all calls to `ForwardVarArgsTo`.
      
      The partial inliner takes care to only pass `ForwardVarArgsTo` if the
      varargs handing is done in the outlined function. It checks that vastart
      is not part of the function to be inlined.
      
      `test/Transforms/CodeExtractor/PartialInlineNoInline.ll` (already part
      of the repo) checks we do not do partial inlining if vastart is used in
      a basic block that will be inlined.
      
      Reviewers: davide, davidxl, grosser
      
      Reviewed By: davide, davidxl, grosser
      
      Subscribers: gyiu, grosser, eraman, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D39607
      
      llvm-svn: 318028
      0e9dec67
  17. Nov 10, 2017
  18. Nov 09, 2017
  19. Nov 08, 2017
  20. Nov 06, 2017
    • Adrian Prantl's avatar
    • Sanjay Patel's avatar
      [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag · 629c4115
      Sanjay Patel authored
      As discussed on llvm-dev:
      http://lists.llvm.org/pipermail/llvm-dev/2016-November/107104.html
      and again more recently:
      http://lists.llvm.org/pipermail/llvm-dev/2017-October/118118.html
      
      ...this is a step in cleaning up our fast-math-flags implementation in IR to better match
      the capabilities of both clang's user-visible flags and the backend's flags for SDNode.
      
      As proposed in the above threads, we're replacing the 'UnsafeAlgebra' bit (which had the 
      'umbrella' meaning that all flags are set) with a new bit that only applies to algebraic 
      reassociation - 'AllowReassoc'.
      
      We're also adding a bit to allow approximations for library functions called 'ApproxFunc' 
      (this was initially proposed as 'libm' or similar).
      
      ...and we're out of bits. 7 bits ought to be enough for anyone, right? :) FWIW, I did 
      look at getting this out of SubclassOptionalData via SubclassData (spacious 16-bits), 
      but that's apparently already used for other purposes. Also, I don't think we can just 
      add a field to FPMathOperator because Operator is not intended to be instantiated. 
      We'll defer movement of FMF to another day.
      
      We keep the 'fast' keyword. I thought about removing that, but seeing IR like this:
      %f.fast = fadd reassoc nnan ninf nsz arcp contract afn float %op1, %op2
      ...made me think we want to keep the shortcut synonym.
      
      Finally, this change is binary incompatible with existing IR as seen in the 
      compatibility tests. This statement:
      "Newer releases can ignore features from older releases, but they cannot miscompile 
      them. For example, if nsw is ever replaced with something else, dropping it would be 
      a valid way to upgrade the IR." 
      ( http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility )
      ...provides the flexibility we want to make this change without requiring a new IR 
      version. Ie, we're not loosening the FP strictness of existing IR. At worst, we will 
      fail to optimize some previously 'fast' code because it's no longer recognized as 
      'fast'. This should get fixed as we audit/squash all of the uses of 'isFast()'.
      
      Note: an inter-dependent clang commit to use the new API name should closely follow 
      commit.
      
      Differential Revision: https://reviews.llvm.org/D39304
      
      llvm-svn: 317488
      629c4115
  21. Nov 04, 2017
  22. Nov 03, 2017
Loading