Skip to content
  1. Feb 04, 2019
    • Julian Lettner's avatar
      [SanitizerCoverage] Clang crashes if user declares `__sancov_lowest_stack` variable · 29ac3a5b
      Julian Lettner authored
      Summary:
      If the user declares or defines `__sancov_lowest_stack` with an
      unexpected type, then `getOrInsertGlobal` inserts a bitcast and the
      following cast fails:
      ```
      Constant *SanCovLowestStackConstant =
             M.getOrInsertGlobal(SanCovLowestStackName, IntptrTy);
      SanCovLowestStack = cast<GlobalVariable>(SanCovLowestStackConstant);
      ```
      
      This variable is a SanitizerCoverage implementation detail and the user
      should generally never have a need to access it, so we emit an error
      now.
      
      rdar://problem/44143130
      
      Reviewers: morehouse
      
      Differential Revision: https://reviews.llvm.org/D57633
      
      llvm-svn: 353100
      29ac3a5b
    • David Major's avatar
      gn build: Windows: use a more standard format for PDB filenames · 1137fce9
      David Major authored
      The current build was producing names like llvm-undname.exe.pdb, which looks unusual to me at least. This switches them to the more common llvm-undname.pdb style.
      
      Differential Revision: https://reviews.llvm.org/D57613
      
      llvm-svn: 353099
      1137fce9
    • David Major's avatar
      gn build: Revert r353094 (bad merge) · d1934853
      David Major authored
      llvm-svn: 353098
      d1934853
    • Nicolai Haehnle's avatar
      [InstCombine] Cleanup the TFE/LWE check in AMDGPU SimplifyDemanded · a69146e6
      Nicolai Haehnle authored
      Summary:
      The fix added in r352904 is not quite correct, or rather misleading:
      
      1. When the texfailctrl (TFC) argument was non-constant, the fix assumed
         non-TFE/LWE, which is incorrect.
      
      2. Regardless, this code path cannot even be hit for correct
         TFE/LWE-enabled calls, because those return a struct. Added
         a test case for those for completeness.
      
      Change-Id: I92d314dbc67a2670f6d7adaab765ef45f56a49cf
      
      Reviewers: hliao, dstuttard, arsenm
      
      Subscribers: kzhuravl, jvesely, wdng, yaxunl, tpr, t-tye, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57681
      
      llvm-svn: 353097
      a69146e6
    • Craig Topper's avatar
      [X86] Add test case for report_fatal_error added in r352699. · 4ca0b850
      Craig Topper authored
      r352699 replaced an llvm_unreachable with a report_fatal_error. This patch adds a test case for it.
      
      llvm-svn: 353096
      4ca0b850
    • Craig Topper's avatar
      [CodeGen][ARC][SystemZ][WebAssembly] Use MachineInstr::isInlineAsm in more... · c45e39b3
      Craig Topper authored
      [CodeGen][ARC][SystemZ][WebAssembly] Use MachineInstr::isInlineAsm in more places instead of just comparing opcode. NFCI
      
      I'm looking at adding a second INLINEASM opcode for better modeling asm-goto
      as a terminator. Using the existing predicate will reduce teh number of
      places that will need to use the new opcode.
      
      llvm-svn: 353095
      c45e39b3
    • David Major's avatar
      gn build: Windows: use a more standard format for PDB filenames · 1469ff41
      David Major authored
      The current build was producing names like llvm-undname.exe.pdb, which looks unusual to me at least. This switches them to the more common llvm-undname.pdb style.
      
      Differential Revision: https://reviews.llvm.org/D57613
      
      llvm-svn: 353094
      1469ff41
    • David Major's avatar
      gn build: Windows: write PDBs when is_debug · 3c659cb2
      David Major authored
      Without /DEBUG, the /Zi doesn't on its own create PDB files.
      
      And since ninja runs multiple compilations in parallel, we need /FS to prevent contention on PDBs.
      
      Differential Revision: https://reviews.llvm.org/D57612
      
      llvm-svn: 353093
      3c659cb2
    • Malcolm Parsons's avatar
      [clang-tidy] Handle unions with existing default-member-init · a7c957fd
      Malcolm Parsons authored
      Summary:
      clang-tidy's modernize-use-default-member-init was crashing for unions
      with an existing default member initializer.
      
      Fixes PR40492
      
      Reviewers: aaron.ballman, alexfh, JonasToth
      
      Reviewed By: JonasToth
      
      Subscribers: JonasToth, riccibruno, xazax.hun, cfe-commits
      
      Tags: #clang, #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D57665
      
      llvm-svn: 353092
      a7c957fd
    • Aditya Nandakumar's avatar
      [Tablegen][DAG]: Fix build breakage when LLVM_ENABLE_DAGISEL_COV=1 · 9b6b9a57
      Aditya Nandakumar authored
      LLVM_ENABLE_DAGISEL_COV can be used to instrument DAGISel tablegen
      selection code to show which patterns along with Complex patterns were
      used when selecting instructions. Unfortunately this is turned off by
      default and was broken but never tested.
      This required a simple fix (missing new line) to get it to build again.
      
      llvm-svn: 353091
      9b6b9a57
    • Philip Pfaffe's avatar
      [NewPM][MSan] Add Options Handling · 0ee6a933
      Philip Pfaffe authored
      Summary: This patch enables passing options to msan via the passes pipeline, e.e., -passes=msan<recover;kernel;track-origins=4>.
      
      Reviewers: chandlerc, fedor.sergeev, leonardchan
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57640
      
      llvm-svn: 353090
      0ee6a933
    • Wolfgang Pieb's avatar
      [DEBUGINFO] Reposting r352642: Handle restore instructions in LiveDebugValues · 90d856cd
      Wolfgang Pieb authored
      The LiveDebugValues pass recognizes spills but not restores, which can
      cause large gaps in location information for some variables, depending
      on control flow. This patch make LiveDebugValues recognize restores and
      generate appropriate DBG_VALUE instructions.
      
      This patch was posted previously with r352642 and reverted in r352666 due
      to buildbot errors. A missing return statement was the cause for the 
      failures.
      
      Reviewers: aprantl, NicolaPrica
      
      Differential Revision: https://reviews.llvm.org/D57271
      
      llvm-svn: 353089
      90d856cd
    • Johannes Doerfert's avatar
      Generalize pthread callback test case · 690a2046
      Johannes Doerfert authored
      Changes suggested by Eli Friedman <efriedma@quicinc.com>
      
      llvm-svn: 353088
      690a2046
    • Jonas Devlieghere's avatar
      Update stale comment in lang/c/struct_types/main.c · c0f00a1f
      Jonas Devlieghere authored
      rdar://47322760
      
      llvm-svn: 353087
      c0f00a1f
    • JF Bastien's avatar
      Support tests in freestanding · 2df59c50
      JF Bastien authored
      Summary:
      Freestanding is *weird*. The standard allows it to differ in a bunch of odd
      manners from regular C++, and the committee would like to improve that
      situation. I'd like to make libc++ behave better with what freestanding should
      be, so that it can be a tool we use in improving the standard. To do that we
      need to try stuff out, both with "freestanding the language mode" and
      "freestanding the library subset".
      
      Let's start with the super basic: run the libc++ tests in freestanding, using
      clang as the compiler, and see what works. The easiest hack to do this:
      
      In utils/libcxx/test/config.py add:
      
        self.cxx.compile_flags += ['-ffreestanding']
      
      Run the tests and they all fail.
      
      Why? Because in freestanding `main` isn't special. This "not special" property
      has two effects: main doesn't get mangled, and main isn't allowed to omit its
      `return` statement. The first means main gets mangled and the linker can't
      create a valid executable for us to test. The second means we spew out warnings
      (ew) and the compiler doesn't insert the `return` we omitted, and main just
      falls of the end and does whatever undefined behavior (if you're luck, ud2
      leading to non-zero return code).
      
      Let's start my work with the basics. This patch changes all libc++ tests to
      declare `main` as `int main(int, char**` so it mangles consistently (enabling us
      to declare another `extern "C"` main for freestanding which calls the mangled
      one), and adds `return 0;` to all places where it was missing. This touches 6124
      files, and I apologize.
      
      The former was done with The Magic Of Sed.
      
      The later was done with a (not quite correct but decent) clang tool:
      
        https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed
      
      This works for most tests, though I did have to adjust a few places when e.g.
      the test runs with `-x c`, macros are used for main (such as for the filesystem
      tests), etc.
      
      Once this is in we can create a freestanding bot which will prevent further
      regressions. After that, we can start the real work of supporting C++
      freestanding fairly well in libc++.
      
      <rdar://problem/47754795>
      
      Reviewers: ldionne, mclow.lists, EricWF
      
      Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D57624
      
      llvm-svn: 353086
      2df59c50
    • Petr Hosek's avatar
      [CMake] Support CMake variables for setting target, sysroot and toolchain · 6fd4e7fe
      Petr Hosek authored
      CMake has a standard way of setting target triple, sysroot and external
      toolchain through CMAKE_<LANG>_COMPILER_TARGET, CMAKE_SYSROOT and
      CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN. These are turned into
      corresponding --target=, --sysroot= and --gcc-toolchain= variables add
      included appended to CMAKE_<LANG>_FLAGS.
      
      libunwind, libc++abi, libc++ provides their own mechanism through
      <PROJECT>_TARGET_TRIPLE, <PROJECT>_SYSROOT and <PROJECT>_GCC_TOOLCHAIN
      variables. These are also passed to lit via lit.site.cfg, and lit config
      uses these to set the corresponding compiler flags when building tessts.
      
      This means that there are two different ways of setting target, sysroot
      and toolchain, but only one is properly supported in lit. This change
      extends CMake build for libunwind, libc++abi and libc++ to also support
      the CMake variables in addition to project specific ones in lit.
      
      Differential Revision: https://reviews.llvm.org/D57670
      
      llvm-svn: 353084
      6fd4e7fe
    • Scott Linder's avatar
      [AMDGPU] Support emitting GOT relocations for function calls · d19d1972
      Scott Linder authored
      Differential Revision: https://reviews.llvm.org/D57416
      
      llvm-svn: 353083
      d19d1972
    • Michael Kruse's avatar
      [WarnMissedTransforms] Do not warn about already vectorized loops. · 70560a0a
      Michael Kruse authored
      LoopVectorize adds llvm.loop.isvectorized, but leaves
      llvm.loop.vectorize.enable. Do not consider such a loop for user-forced
      vectorization since vectorization already happened -- by prioritizing
      llvm.loop.isvectorized except for TM_SuppressedByUser.
      
      Fixes http://llvm.org/PR40546
      
      Differential Revision: https://reviews.llvm.org/D57542
      
      llvm-svn: 353082
      70560a0a
    • Matt Arsenault's avatar
      GlobalISel: Fix CheckMachineFunction passing if ReadCheckFile files · 22309c87
      Matt Arsenault authored
      This could be tested, but the FileCheck library spams the error
      message to the console.
      
      llvm-svn: 353081
      22309c87
    • Matt Arsenault's avatar
      GlobalISel: Allow constructing SrcOp/DstOp from MachineOperand · f3a46d0a
      Matt Arsenault authored
      llvm-svn: 353080
      f3a46d0a
    • Hyrum Wright's avatar
      [clang-tidy] Add the abseil-duration-unnecessary-conversion check · 1c250bf2
      Hyrum Wright authored
      Differential Revision: https://reviews.llvm.org/D57353
      
      llvm-svn: 353079
      1c250bf2
    • Matt Arsenault's avatar
      GlobalISel: Fix parameter name in documentation · d7fa13c1
      Matt Arsenault authored
      llvm-svn: 353078
      d7fa13c1
    • Matt Arsenault's avatar
      GlobalISel: Fix CSE handling of buildConstant · 8121ec26
      Matt Arsenault authored
      This fixes two problems with CSE done in buildConstant. First, this
      would hit an assert when used with a vector result type. Solve this by
      allowing CSE on the vector elements, but not on the result vector for
      now.
      
      Second, this was also performing the CSE based on the input
      ConstantInt pointer. The underlying buildConstant could potentially
      convert the constant depending on the result type, giving in a
      different ConstantInt*. Stop allowing the APInt and ConstantInt forms
      from automatically casting to the result type to avoid any similar
      problems in the future.
      
      llvm-svn: 353077
      8121ec26
    • Heejin Ahn's avatar
      [WebAssembly] clang-tidy (NFC) · a1cc4ea7
      Heejin Ahn authored
      Summary:
      This patch fixes clang-tidy warnings on wasm-only files.
      The list of checks used is:
      `-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,readability-identifier-naming,modernize-*`
      (LLVM's default .clang-tidy list is the same except it does not have
      `modernize-*`.)
      
      The list of fixes are:
      - Variable names start with an uppercase letter
      - Function names start with a lowercase letter
      - Use `auto` when you use casts so the type is evident
      
      Reviewers: sbc100
      
      Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D57499
      
      llvm-svn: 353076
      a1cc4ea7
    • Heejin Ahn's avatar
      [WebAssembly] clang-tidy (NFC) · 18c56a07
      Heejin Ahn authored
      Summary:
      This patch fixes clang-tidy warnings on wasm-only files.
      The list of checks used is:
      `-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,readability-identifier-naming,modernize-*`
      (LLVM's default .clang-tidy list is the same except it does not have
      `modernize-*`. But I've seen in multiple CLs in LLVM the modernize style
      was recommended and code was fixed based on the style, so I added it as
      well.)
      
      The common fixes are:
      - Variable names start with an uppercase letter
      - Function names start with a lowercase letter
      - Use `auto` when you use casts so the type is evident
      - Use inline initialization for class member variables
      - Use `= default` for empty constructors / destructors
      - Use `using` in place of `typedef`
      
      Reviewers: sbc100, tlively, aardappel
      
      Subscribers: dschuff, sunfish, jgravelle-google, yurydelendik, kripken, MatzeB, mgorny, rupprecht, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D57500
      
      llvm-svn: 353075
      18c56a07
    • Jordan Rupprecht's avatar
      [llvm-objcopy][NFC] simplify an error return · 2e862c75
      Jordan Rupprecht authored
      llvm-svn: 353074
      2e862c75
    • Roman Lebedev's avatar
      [X86] X86DAGToDAGISel::matchBitExtract(): prepare 'control' in 32 bits · b7ecc9b6
      Roman Lebedev authored
      Summary:
      Noticed while looking at D56052.
      ```
        // The 'control' of BEXTR has the pattern of:
        // [15...8 bit][ 7...0 bit] location
        // [ bit count][     shift] name
        // I.e. 0b000000011'00000001 means  (x >> 0b1) & 0b11
      ```
      I.e. we do not care about any of the bits aside from the low 16 bits.
      So there is no point in doing the `slh`,`or` in 64 bits,
      let's just do everything in 32 bits, and anyext if needed.
      
      We could do that in 16 even, but we intentionally don't
      zext to i16 (longer encoding IIRC),
      so i'm guessing the same applies here.
      
      Reviewers: craig.topper, andreadb, RKSimon
      
      Reviewed By: craig.topper
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D56715
      
      llvm-svn: 353073
      b7ecc9b6
    • Matt Arsenault's avatar
      GlobalISel: Improve gtest usage · b3e86709
      Matt Arsenault authored
      Don't unnecessarily use ASSERT_*, and print the MachineFunction
      on failure.
      
      llvm-svn: 353072
      b3e86709
    • David Callahan's avatar
      Adjust cardinality of internal inliner thresholds · fd3e7a93
      David Callahan authored
      Summary:
      While compiling openJDK11 (also other workloads), some make files would pass both  CFLAGS  and LDFLAGS at link step ; resulting in duplicate options on the command line when one is using LTO and trying to influence the inliner. Most of the internal flags are ZeroOrMore, this diff changes the remaining ones.
      
      Reviewers: david2050, twoh, modocache
      
      Reviewed By: twoh
      
      Subscribers: mehdi_amini, dexonsmith, eraman, haicheng, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57537
      
      Patch by: Abdoul-Kader Keita
      
      llvm-svn: 353071
      fd3e7a93
    • Craig Topper's avatar
      [X86] Add ST0 as an implicit def/use of x87 load/store instructions during FP stackifying. · 8ea72a82
      Craig Topper authored
      These instructions implicitly operate on ST0, but we don't currently add that information to the MachineInstr. We also don't add it the tablegen definitions either.
      
      For the most part this doesn't cause any problems because the stackifying occurs after register allocation. All the instructions are marked as having side effects so the postRA scheduler won't reorder them amongst themselves.
      
      But nothing stops inline assembly using X87 instructions from being reordered around other x87 instructions if that inline assembly wasn't marked volatile.
      
      The two test cases I've identified so far in PR40539 involve loads and stores used to set up the inline assembly or capture the results of the inline assembly ending up in the wrong order.
      
      This patch adds implicit ST0 uses/defs to the load/store instructions to prevent this from happening.
      
      I plan to fix all of the FP instructions, but the binops are bit trickier to get right. So I've chosen fixing the known test cases as a good first step.
      
      I think we also need to update the tablegen descriptions so MS inline assembly infers the right clobbers, but I haven't checked that yet.
      
      Differential Revision: https://reviews.llvm.org/D57644
      
      llvm-svn: 353070
      8ea72a82
    • Matt Arsenault's avatar
      GlobalISel: Fix moreElementsToNextPow2 · 07238286
      Matt Arsenault authored
      This was completely broken. The condition was inverted, and changed
      the element type for vectors of pointers.
      
      Fixes bug 40592.
      
      llvm-svn: 353069
      07238286
    • Jordan Rupprecht's avatar
      [llvm-objcopy][NFC] Use StringSaver for --keep-global-symbols · 5745c5f5
      Jordan Rupprecht authored
      Summary: Use StringSaver/BumpPtrAlloc when parsing lines from --keep-global-symbols files. This allows us to consistently use StringRef for driver options, which avoids copying the full strings for each object copied, as well as simplifies part of D57517.
      
      Reviewers: jhenderson, evgeny777, alexshap
      
      Subscribers: jakehehrlich
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57617
      
      llvm-svn: 353068
      5745c5f5
    • Wouter van Oortmerssen's avatar
      [WebAssembly] Make segment/size/type directives optional in asm · 0b3cf247
      Wouter van Oortmerssen authored
      Summary:
      These were "boilerplate" that repeated information already present
      in .functype and end_function, that needed to be repeated to Please
      the particular way our object writing works, and missing them would
      generate errors.
      
      Instead, we generate the information for these automatically so the
      user can concern itself with writing more canonical wasm functions
      that always work as expected.
      
      Reviewers: dschuff, sbc100
      
      Subscribers: jgravelle-google, aheejin, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D57546
      
      llvm-svn: 353067
      0b3cf247
    • Sam Clegg's avatar
      [WebAssembly] Update relocation naming to match llvm change. NFC. · 79e33171
      Sam Clegg authored
      Differential Revision: https://reviews.llvm.org/D57698
      
      llvm-svn: 353066
      79e33171
    • Jessica Paquette's avatar
      Revert "[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR" · 92834ffc
      Jessica Paquette authored
      This reverts commit b05ecba6d687fcb3078509220c67458bf1d77a2e.
      
      Apparently adding floor breaks AMDGPU somehow, so I have to back this out
      while I look into it.
      
      llvm-svn: 353065
      92834ffc
    • Jessica Paquette's avatar
      Revert "[GlobalISel] Add IRTranslator support for G_FFLOOR" · 834bded9
      Jessica Paquette authored
      This reverts commit 8bbd570fd5205a04d88d2e5513a6e4adbd028039.
      
      Apparently adding ffloor breaks AMDGPU somehow, so I need to back this out
      while I look into it.
      
      llvm-svn: 353064
      834bded9
    • Nico Weber's avatar
      gn build: Merge r352944 · 11256b21
      Nico Weber authored
      llvm-svn: 353063
      11256b21
    • Sam Clegg's avatar
      [WebAssembly] Rename relocations from R_WEBASSEMBLY_ to R_WASM_ · d1152a26
      Sam Clegg authored
      See https://github.com/WebAssembly/tool-conventions/pull/95.
      
      This is less typing and IMHO more readable, and it also fits with
      our naming around the binary format which tends to use the short name.
      e.g.
      
      include/llvm/BinaryFormat/Wasm.h
      tools/llvm-objdump/WasmDump.cpp
      etc..
      
      Differential Revision: https://reviews.llvm.org/D57611
      
      llvm-svn: 353062
      d1152a26
    • Craig Topper's avatar
      [X86] Print all register forms of x87 fadd/fsub/fdiv/fmul as having two arguments where on is %st. · bf7593ec
      Craig Topper authored
      All of these instructions consume one encoded register and the other register is %st. They either write the result to %st or the encoded register. Previously we printed both arguments when the encoded register was written. And we printed one argument when the result was written to %st. For the stack popping forms the encoded register is always the destination and we didn't print both operands. This was inconsistent with gcc and objdump and just makes the output assembly code harder to read.
      
      This patch changes things to always print both operands making us consistent with gcc and objdump. The parser should still be able to handle the single register forms just as it did before. This also matches the GNU assembler behavior.
      
      llvm-svn: 353061
      bf7593ec
    • Sam Clegg's avatar
      [WebAssembly] Remove redundant namespaces qualifiers. NFC. · d00c02c0
      Sam Clegg authored
      Differential Revision: https://reviews.llvm.org/D57610
      
      llvm-svn: 353060
      d00c02c0
Loading