Skip to content
  1. Dec 13, 2018
    • Mircea Trofin's avatar
      [llvm] Address base discriminator overflow in X86DiscriminateMemOps · 41c729e7
      Mircea Trofin authored
      Summary:
      Macros are expanded on a single line. In case of large expansions,
      with sufficiently many instructions with memory operands (and when
      -fdebug-info-for-profiling is requested), we may be unable to generate
      new base discriminator values - new values overflow (base
      discriminators may not be larger than 2^12).
      
      This CL warns instead of asserting in such a case. A subsequent CL
      will add APIs to check for overflow before creating new debug info.
      
      See https://bugs.llvm.org/show_bug.cgi?id=39890
      
      Reviewers: davidxl, wmi, gbedwell
      
      Reviewed By: davidxl
      
      Subscribers: aprantl, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D55643
      
      llvm-svn: 349075
      41c729e7
    • Jordan Rupprecht's avatar
      [llvm-size][libobject] Add explicit "inTextSegment" methods similar to... · 4888c4ab
      Jordan Rupprecht authored
      [llvm-size][libobject] Add explicit "inTextSegment" methods similar to "isText" section methods to calculate size correctly.
      
      Summary:
      llvm-size uses "isText()" etc. which seem to indicate whether the section contains code-like things, not whether or not it will actually go in the text segment when in a fully linked executable.
      
      The unit test added (elf-sizes.test) shows some types of sections that cause discrepencies versus the GNU size tool. llvm-size is not correctly reporting sizes of things mapping to text/data segments, at least for ELF files.
      
      This fixes pr38723.
      
      Reviewers: echristo, Bigcheese, MaskRay
      
      Reviewed By: MaskRay
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54369
      
      llvm-svn: 349074
      4888c4ab
    • Hyrum Wright's avatar
      [clang-tidy] Add the abseil-duration-subtraction check · 35cb7e9f
      Hyrum Wright authored
      Summary:
      This check uses the context of a subtraction expression as well as knowledge
      about the Abseil Time types, to infer the type of the second operand of some
      subtraction expressions in Duration conversions. For example:
      
         absl::ToDoubleSeconds(duration) - foo
      
      can become
         absl::ToDoubleSeconds(duration - absl::Seconds(foo))
      
      This ensures that time calculations are done in the proper domain, and also
      makes it easier to further deduce the types of the second operands to these
      expressions.
      
      Reviewed By: JonasToth
      
      Tags: #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D55245
      
      llvm-svn: 349073
      35cb7e9f
    • Craig Topper's avatar
      [CostModel][X86] Don't count 2 shuffles on the last level of a pairwise... · c6bfb057
      Craig Topper authored
      [CostModel][X86] Don't count 2 shuffles on the last level of a pairwise arithmetic or min/max reduction
      
      This is split from D55452 with the correct patch this time.
      
      Pairwise reductions require two shuffles on every level but the last. On the last level the two shuffles are <1, u, u, u...> and <0, u, u, u...>, but <0, u, u, u...> will be dropped by InstCombine/DAGCombine as being an identity shuffle.
      
      Differential Revision: https://reviews.llvm.org/D55615
      
      llvm-svn: 349072
      c6bfb057
    • Louis Dionne's avatar
      5f1706f3
    • Stefan Granitz's avatar
      [CMake] llvm_codesign workaround for Xcode double-signing errors · 405c5109
      Stefan Granitz authored
      Summary:
      When using Xcode to build LLVM with code signing, the post-build rule is executed even if the actual build-step was skipped. This causes double-signing errors. We can currently only avoid it by passing the `--force` flag.
      
      Plus some polishing for my previous patch D54443.
      
      Reviewers: beanz, kubamracek
      
      Reviewed By: kubamracek
      
      Subscribers: #lldb, mgorny, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D55116
      
      llvm-svn: 349070
      405c5109
    • Davide Italiano's avatar
      [LoopUtils] Use i32 instead of `void`. · 9737096b
      Davide Italiano authored
      The actual type of the first argument of the @dbg intrinsic
      doesn't really matter as we're setting it to `undef`, but the
      bitcode reader is picky about `void` types.
      
      llvm-svn: 349069
      9737096b
    • Tom Stellard's avatar
      Don't add unnecessary compiler flags to llvm-config output · dda33128
      Tom Stellard authored
      Summary:
      llvm-config --cxxflags --cflags, should only output the minimal flags
      required to link against the llvm libraries.  They currently contain
      all flags used to compile llvm including flags like -g, -pedantic,
      -Wall, etc, which users may not always want.
      
      This changes the llvm-config output to only include flags that have been
      explictly added to the COMPILE_FLAGS property of the llvm-config target
      by the llvm build system.
      
      llvm.org/PR8220
      
      Output from llvm-config when running cmake with:
      cmake -G Ninja .. -DCMAKE_CXX_FLAGS=-funroll-loops
      
      Before:
      
      --cppflags: -I$HEADERS_DIR/llvm/include -I$HEADERS_DIR/llvm/build/include
                  -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
      --cflags:   -I$HEADERS_DIR/llvm/include -I$HEADERS_DIR/llvm/build/include
                  -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings \
                  -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough \
                  -Wno-comment -fdiagnostics-color -g -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS \
                  -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
      --cxxflags: -I$HEADERS_DIR/llvm/include -I$HEADERS_DIR/llvm/build/include\
                  -funroll-loops -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall \
                  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers \
                  -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized \
                  -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment \
                  -fdiagnostics-color -g  -fno-exceptions -fno-rtti -D_GNU_SOURCE -D_DEBUG \
                  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
      
      After:
      
      --cppflags: -I$HEADERS_DIR/llvm/include -I$HEADERS_DIR/llvm/build/include \
                  -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
      --cflags:   -I$HEADERS_DIR/llvm/include -I$HEADERS_DIR/llvm/build/include \
                  -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
      --cxxflags: -I$HEADERS_DIR/llvm/include -I$HEADERS_DIR/llvm/build/include \
                   -std=c++11   -fno-exceptions -fno-rtti \
                   -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
      
      Reviewers: sylvestre.ledru, infinity0, mgorny
      
      Reviewed By: sylvestre.ledru, mgorny
      
      Subscribers: mgorny, dmgreen, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D55391
      
      llvm-svn: 349068
      dda33128
    • Zachary Turner's avatar
      [NativePDB] Add support for local variables. · d3d2b9b8
      Zachary Turner authored
      This patch adds support for parsing and evaluating local variables.
      using the native pdb plugin.
      
      Differential Revision: https://reviews.llvm.org/D55575
      
      llvm-svn: 349067
      d3d2b9b8
    • Zachary Turner's avatar
      Correctly handle skewed streams in drop_front() method. · a05ae9db
      Zachary Turner authored
      When calling BinaryStreamArray::drop_front(), if the stream
      is skewed it means we must never drop the first bytes of the
      stream since offsets which occur in records assume the existence
      of those bytes.  So if we want to skip the first record in a
      stream, then what we really want to do is just set the begin
      pointer to the next record.  But we shouldn't actually remove
      those bytes from the underlying view of the data.
      
      llvm-svn: 349066
      a05ae9db
    • Adrian Prantl's avatar
      Reinstate DW_AT_comp_dir support after D55519. · 046d100b
      Adrian Prantl authored
      The DIFile used by the CU is special and distinct from the main source
      file. Its directory part specifies what becomes the DW_AT_comp_dir
      (the compilation directory), even if the source file was specified
      with an absolute path.
      
      To support the .dwo workflow, a valid DW_AT_comp_dir is necessary even
      if source files were specified with an absolute path.
      
      llvm-svn: 349065
      046d100b
    • Sylvestre Ledru's avatar
      Try to update the test to fix the breakage · 8b325fc7
      Sylvestre Ledru authored
      With the new warning, we are showing one more output in the test.
      
      llvm-svn: 349064
      8b325fc7
    • Ilya Biryukov's avatar
      [CodeComplete] Adhere to LLVM naming style in CodeCompletionTest. NFC · 69e181d4
      Ilya Biryukov authored
      Also reuses the same var for multiple to reduce the chance of
      accidentally referecing the previous test.
      
      llvm-svn: 349063
      69e181d4
    • Greg Clayton's avatar
      Fix MinidumpParser::GetFilteredModuleList() and test it · e55979b1
      Greg Clayton authored
      The MinidumpParser::GetFilteredModuleList() code was attempting to iterate through the entire module list and if it found more than one entry for a given module name, it wanted to pick the MinidumpModule with the lowest address. A bug existed where it wasn't doing that due to "exists" variable being inverted. "exists" was set to true if it was inserted, not if it existed. Furthermore, the order of the modules would be modified by sorting all modules from low address to high address (using MinidumpModule::base_of_image). This fix also maintains the original order which means your executable is at index 0 as intended instead of some random shared library.
      
      Tests were added to ensure this functionality doesn't regress.
      
      Differential Revision: https://reviews.llvm.org/D55614
      
      llvm-svn: 349062
      e55979b1
    • Ilya Biryukov's avatar
      [CodeComplete] Temporarily disable failing assertion · 67dbeb6c
      Ilya Biryukov authored
      Found the case in the clang codebase where the assertion fires.
      To avoid crashing assertion-enabled builds before I re-add the missing
      operation.
      Will restore the assertion alongside the upcoming fix.
      
      llvm-svn: 349061
      67dbeb6c
    • Francis Visoiu Mistrih's avatar
      [MachO][TLOF] Add support for local symbols in the indirect symbol table · 91e69d8a
      Francis Visoiu Mistrih authored
      On 32-bit archs, before, we would assume that an indirect symbol will
      never have local linkage. This can lead to miscompiles where the
      symbol's value would be 0 and the linker would use that value, because
      the indirect symbol table would contain the value
      `INDIRECT_SYMBOL_LOCAL` for that specific symbol.
      
      Differential Revision: https://reviews.llvm.org/D55573
      
      llvm-svn: 349060
      91e69d8a
    • David Green's avatar
      Fix CodeCompleteTest.cpp for older gcc plus ccache builds · 0250e29e
      David Green authored
      Some versions of gcc, especially when invoked through ccache (-E), can have
      trouble with raw string literals inside macros. This moves the string out of
      the macro.
      
      llvm-svn: 349059
      0250e29e
    • Sanjay Patel's avatar
      [DAGCombiner] after simplifying demanded elements of vector operand of... · 791ae69a
      Sanjay Patel authored
      [DAGCombiner] after simplifying demanded elements of vector operand of extract, revisit the extract; 2nd try
      
      This is a retry of rL349051 (reverted at rL349056). I changed the check for dead-ness from
      number of uses to an opcode test for DELETED_NODE based on existing similar code.
      
      Differential Revision: https://reviews.llvm.org/D55655
      
      llvm-svn: 349058
      791ae69a
    • Simon Pilgrim's avatar
    • Sanjay Patel's avatar
      revert rL349051: [DAGCombiner] after simplifying demanded elements of vector... · c56f5728
      Sanjay Patel authored
      revert rL349051: [DAGCombiner] after simplifying demanded elements of vector operand of extract, revisit the extract
      
      This causes an address sanitizer bot failure:
      http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/27187/steps/check-llvm%20asan/logs/stdio
      
      llvm-svn: 349056
      c56f5728
    • Daniel Sanders's avatar
      Recommit r349041: [tblgen][disasm] Separate encodings from instructions · a39df2e6
      Daniel Sanders authored
      Removed const from the ArrayRef<const EncodingAndInst> to avoid the
      std::vector<const EncodingAndInst> that G++ saw
      
      llvm-svn: 349055
      a39df2e6
    • Sylvestre Ledru's avatar
      Make -Wstring-plus-int warns even if when the result is not out of bounds · 8523c085
      Sylvestre Ledru authored
      Summary: Patch by Arnaud Bienner
      
      Reviewers: sylvestre.ledru, thakis
      
      Reviewed By: thakis
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55382
      
      llvm-svn: 349054
      8523c085
    • Ilya Biryukov's avatar
      [CodeComplete] Fill preferred type on binary expressions · 4974d75d
      Ilya Biryukov authored
      Reviewers: kadircet
      
      Reviewed By: kadircet
      
      Subscribers: arphaman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55648
      
      llvm-svn: 349053
      4974d75d
    • Simon Pilgrim's avatar
      [X86][SSE] Fix all remaining modulo vector rotation amounts (PR38243) · b0b2f150
      Simon Pilgrim authored
      There's still a couple of minor SimplifyDemandedElts regressions in some of the shift amount splats that will be fixed in future patches.
      
      llvm-svn: 349052
      b0b2f150
    • Sanjay Patel's avatar
    • Ilya Biryukov's avatar
      [CodeComplete] Set preferred type to bool on conditions · 4110967c
      Ilya Biryukov authored
      Reviewers: kadircet
      
      Reviewed By: kadircet
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55431
      
      llvm-svn: 349050
      4110967c
    • Eric Liu's avatar
      [clangd] Enable cross-namespace completions by default in clangd · e2012972
      Eric Liu authored
      Summary:
      Code completion will suggest symbols from any scope (incl. inaccessible
      scopes) when there's no qualifier explicitly specified. E.g.
      {F7689815}
      
      As we are assigning relatively low scores for cross-namespace completion items, the overall code completion quality doesn't regress. The feature has been tried out by a few folks, and the feedback is generally positive, so I think it should be ready to be enabled by default.
      
      Reviewers: hokein, ilya-biryukov, kadircet
      
      Reviewed By: hokein, ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55649
      
      llvm-svn: 349049
      e2012972
    • Daniel Cederman's avatar
      [Sparc] Add membar assembler tags · 77611426
      Daniel Cederman authored
      Summary: The Sparc V9 membar instruction can enforce different types of
      memory orderings depending on the value in its immediate field.  In the
      architectural manual the type is selected by combining different assembler
      tags into a mask. This patch adds support for these tags.
      
      Reviewers: jyknight, venkatra, brad
      
      Reviewed By: jyknight
      
      Subscribers: fedor.sergeev, jrtc27, jfb, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53491
      
      llvm-svn: 349048
      77611426
    • Simon Pilgrim's avatar
      ba91ff4a
    • Daniel Sanders's avatar
      Revert r349041: [tblgen][disasm] Separate encodings from instructions · f5f3bef0
      Daniel Sanders authored
      One of the GCC based bots is objecting to a vector of const EncodingAndInst's:
      In file included from /usr/include/c++/8/vector:64,
                       from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/utils/TableGen/CodeGenInstruction.h:22,
                       from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp:15:
      /usr/include/c++/8/bits/stl_vector.h: In instantiation of 'class std::vector<const {anonymous}::EncodingAndInst, std::allocator<const {anonymous}::EncodingAndInst> >':
      /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp:375:32:   required from here
      /usr/include/c++/8/bits/stl_vector.h:351:21: error: static assertion failed: std::vector must have a non-const, non-volatile value_type
             static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/c++/8/bits/stl_vector.h:354:21: error: static assertion failed: std::vector must have the same value_type as its allocator
             static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      llvm-svn: 349046
      f5f3bef0
    • Daniel Cederman's avatar
      [Sparc] Use float register for integer constrained with "f" in inline asm · b5d28440
      Daniel Cederman authored
      Summary:
      Constraining an integer value to a floating point register using "f"
      causes an llvm_unreachable to trigger. This patch allows i32 integers
      to be placed in a single precision float register and i64 integers to
      be placed in a double precision float register. This matches the behavior
      of GCC.
      
      For other types the llvm_unreachable is removed to instead trigger an
      error message that points out the offending line.
      
      Reviewers: jyknight, venkatra
      
      Reviewed By: jyknight
      
      Subscribers: eraman, fedor.sergeev, jrtc27, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51614
      
      llvm-svn: 349045
      b5d28440
    • Jinsong Ji's avatar
      [PowerPC][NFC] Sorting out Pseudo related classes to avoid confusion · c7b43b94
      Jinsong Ji authored
      There are several Pseudo in PowerPC backend. 
      eg:
      
      * ISel Pseudo-instructions , which has let usesCustomInserter=1 in td 
      ExpandISelPseudos -> EmitInstrWithCustomInserter will deal with them.
      * Post-RA pseudo instruction, which has let isPseudo = 1 in td, or Standard pseudo (SUBREG_TO_REG,COPY etc.) 
      ExpandPostRAPseudos -> expandPostRAPseudo will expand them
      * Multi-instruction pseudo operations will expand them PPCAsmPrinter::EmitInstruction
      * Pseudo instruction in CodeEmitter, which has encoding of 0.
      
      Currently, in td files, especially PPCInstrVSX.td, 
      we did not distinguish Post-RA pseudo instruction and Pseudo instruction in CodeEmitter very clearly.
      
      This patch is to
      
      * Rename Pseudo<> class to PPCEmitTimePseudo, which means encoding of 0 in CodeEmitter
      * Introduce new class PPCPostRAExpPseudo <> for previous PostRA Pseudo
      * Introduce new class PPCCustomInserterPseudo <> for previous Isel Pseudo
      
      Differential Revision: https://reviews.llvm.org/D55143
      
      llvm-svn: 349044
      c7b43b94
    • Daniel Sanders's avatar
    • David Carlier's avatar
      [Sanitizer] capsicum further support of the API · a4ee8542
      David Carlier authored
      Reviewers: vitalybuka, krytarowski, emaste
      
      Reviewed By: emaste
      
      Differential Revision: https://reviews.llvm.org/D55622
      
      llvm-svn: 349042
      a4ee8542
    • Daniel Sanders's avatar
      [tblgen][disasm] Separate encodings from instructions · f81ecd2c
      Daniel Sanders authored
      Summary:
      Separate the concept of an encoding from an instruction. This will enable
      the definition of additional encodings for the same instruction which can
      be used to support variable length instruction sets in the disassembler
      (and potentially assembler but I'm not working towards that right now)
      without causing an explosion in the number of Instruction records that
      CodeGen then has to pick between.
      
      Reviewers: bogner, charukcs
      
      Reviewed By: bogner
      
      Subscribers: kparzysz, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52366
      
      llvm-svn: 349041
      f81ecd2c
    • Simon Pilgrim's avatar
      [X86][SSE] Merge the vXi16/vXi32 vector rotation expansion cases. NFCI. · 7c84f7ae
      Simon Pilgrim authored
      Merged the repeated code into a single if().
      
      llvm-svn: 349040
      7c84f7ae
    • Ivan Donchevskii's avatar
      [clang-tidy] Share the forced linking code between clang-tidy tool and plugin · e74d487b
      Ivan Donchevskii authored
      Extract code that forces linking to the separate header and include it in both plugin and standalone tool
      
      Differential Revision: https://reviews.llvm.org/D55595
      
      llvm-svn: 349038
      e74d487b
    • Jonas Paulsson's avatar
      [SystemZ] Pass copy-hinted regs first from getRegAllocationHints(). · e79b1b98
      Jonas Paulsson authored
      When computing register allocation hints for a GRX32Bit register, make sure
      that any of the hinted registers that are also copy hints are returned first
      in the list.
      
      Review: Ulrich Weigand.
      llvm-svn: 349037
      e79b1b98
    • Tatyana Krasnukha's avatar
      Add missing Initialize/Terminate for Architecture plugins · 98fc5487
      Tatyana Krasnukha authored
      llvm-svn: 349036
      98fc5487
    • Daniel Sanders's avatar
      [mir] Serialize DILocation inline when not possible to use a metadata reference · 9f3cf55e
      Daniel Sanders authored
      Summary:
      Sometimes MIR-level passes create DILocations that were not present in the
      LLVM-IR. For example, it may merge two DILocations together to produce a
      DILocation that points to line 0.
      
      Previously, the address of these DILocations were printed which prevented the
      MIR from being read back into LLVM. With this patch, DILocations will use
      metadata references where possible and fall back on serializing them inline like so:
          MOV32mr %stack.0.x.addr, 1, _, 0, _, %0, debug-location !DILocation(line: 1, scope: !15)
      
      Reviewers: aprantl, vsk, arphaman
      
      Reviewed By: aprantl
      
      Subscribers: probinson, llvm-commits
      
      Tags: #debug-info
      
      Differential Revision: https://reviews.llvm.org/D55243
      
      llvm-svn: 349035
      9f3cf55e
Loading