Skip to content
  1. Sep 02, 2016
    • Eric Fiselier's avatar
      Implement __attribute__((require_constant_initialization)) for safe static initialization. · 341e825e
      Eric Fiselier authored
      Summary:
      This attribute specifies expectations about the initialization of static and
      thread local variables. Specifically that the variable has a
      [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization)
      according to the rules of [basic.start.static]. Failure to meet this expectation
      will result in an error.
      
      Static objects with constant initializers avoid hard-to-find bugs caused by
      the indeterminate order of dynamic initialization. They can also be safely
      used by other static constructors across translation units.
      
      This attribute acts as a compile time assertion that the requirements
      for constant initialization have been met. Since these requirements change
      between dialects and have subtle pitfalls it's important to fail fast instead
      of silently falling back on dynamic initialization.
      
      ```c++
        // -std=c++14
        #define SAFE_STATIC __attribute__((require_constant_initialization)) static
        struct T {
          constexpr T(int) {}
          ~T();
        };
        SAFE_STATIC T x = {42}; // OK.
        SAFE_STATIC T y = 42; // error: variable does not have a constant initializer
        // copy initialization is not a constant expression on a non-literal type.
      ```
      This attribute can only be applied to objects with static or thread-local storage
      duration.
      
      Reviewers: majnemer, rsmith, aaron.ballman
      
      Subscribers: jroelofs, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23385
      
      llvm-svn: 280525
      341e825e
    • Rui Ueyama's avatar
      Dispatch without hash table lookup. · a27eecca
      Rui Ueyama authored
      Cmd used to be the single central place to dispatch. It is not longer
      the case because we have a logic for readProvideOrAssignment().
      This patch removes the hash table so that evrything is in a single
      function. This is slightly verbose but should improve readability.
      
      Differential Revision: https://reviews.llvm.org/D24200
      
      llvm-svn: 280524
      a27eecca
    • Jan Vesely's avatar
      AMDGPU: Reorganize store tests · cd6b12b1
      Jan Vesely authored
      Split by AS.
      Merge with some prviously failing tests.
      
      Differential Revision: https://reviews.llvm.org/D23969
      
      llvm-svn: 280523
      cd6b12b1
    • Reid Kleckner's avatar
      [codeview] Use the correct max CV record length of 0xFF00 · fa28396f
      Reid Kleckner authored
      Previously we were splitting our records at 0xFFFF bytes, which the
      Microsoft tools don't like.
      
      Should fix failure on the new Windows self-host buildbot.
      
      This length appears in microsoft-pdb/PDB/dbi/dbiimpl.h
      
      llvm-svn: 280522
      fa28396f
    • Eric Fiselier's avatar
      Revert r280516 since it contained accidental changes. · bcdcbd11
      Eric Fiselier authored
      llvm-svn: 280521
      bcdcbd11
    • Aaron Ballman's avatar
      Based on post-commit feedback over IRC with dblaikie, ideally, we should have... · 8b871d96
      Aaron Ballman authored
      Based on post-commit feedback over IRC with dblaikie, ideally, we should have a SmallVector constructor that accepts anything which can supply a range via ADL begin()/end() calls so that we can construct the SmallVector directly from anything range-like.
      
      Since that doesn't exist right now, use a local variable instead of calling getAssocExprs() twice; NFC.
      
      llvm-svn: 280520
      8b871d96
    • Jonathan Peyton's avatar
      Use 'critical' reduction method when 'atomic' is not available but requested. · 5c32d5ef
      Jonathan Peyton authored
      In case atomic reduction method is not available (the compiler can't generate
      it) the assertion failure occurred if KMP_FORCE_REDUCTION=atomic was specified.
      This change replaces the assertion with a warning and sets the reduction method
      to the default one - 'critical'.
      
      Patch by Olga Malysheva
      
      Differential Revision: https://reviews.llvm.org/D23990
      
      llvm-svn: 280519
      5c32d5ef
    • Kyle Butt's avatar
      IfConversion: Add assertions that both sides of a diamond don't pred-clobber. · e31cc842
      Kyle Butt authored
      One side of a diamond may end with a predicate clobbering instruction.
      That side of the diamond has to be if-converted second. Both sides can't
      clobber the predicate or the ifconversion is invalid. This is checked
      elsewhere, but add an assert as a safety check. NFC
      
      llvm-svn: 280518
      e31cc842
    • Kyle Butt's avatar
      IfConversion: Fix bug introduced by rescanning diamonds. · 8699921c
      Kyle Butt authored
      Passing the wrong values for predicate-clobbering. Simple to miss.
      Added an assert to make this easier to catch in the future.
      
      llvm-svn: 280517
      8699921c
    • Eric Fiselier's avatar
      Implement __attribute__((require_constant_initialization)) for safe static initialization. · 92f8935e
      Eric Fiselier authored
      Summary:
      This attribute specifies expectations about the initialization of static and
      thread local variables. Specifically that the variable has a
      [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization)
      according to the rules of [basic.start.static]. Failure to meet this expectation
      will result in an error.
      
      Static objects with constant initializers avoid hard-to-find bugs caused by
      the indeterminate order of dynamic initialization. They can also be safely
      used by other static constructors across translation units.
      
      This attribute acts as a compile time assertion that the requirements
      for constant initialization have been met. Since these requirements change
      between dialects and have subtle pitfalls it's important to fail fast instead
      of silently falling back on dynamic initialization.
      
      ```c++
        // -std=c++14
        #define SAFE_STATIC __attribute__((require_constant_initialization)) static
        struct T {
          constexpr T(int) {}
          ~T();
        };
        SAFE_STATIC T x = {42}; // OK.
        SAFE_STATIC T y = 42; // error: variable does not have a constant initializer
        // copy initialization is not a constant expression on a non-literal type.
      ```
      This attribute can only be applied to objects with static or thread-local storage
      duration.
      
      Reviewers: majnemer, rsmith, aaron.ballman
      
      Subscribers: jroelofs, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23385
      
      llvm-svn: 280516
      92f8935e
    • Rui Ueyama's avatar
      Add comments. · 626e0b08
      Rui Ueyama authored
      llvm-svn: 280515
      626e0b08
    • Enrico Granata's avatar
      Check for null · b370f183
      Enrico Granata authored
      llvm-svn: 280513
      b370f183
    • Jason Henline's avatar
      [SE] Remove broken doc ref · 91f199c4
      Jason Henline authored
      llvm-svn: 280512
      91f199c4
    • Jason Henline's avatar
      [SE] Doc tweaks · 1ce18561
      Jason Henline authored
      Summary:
      * Sections on main page.
      * Use std algorithm for equality check in example.
      * Add tree view on left side.
      * Add extra CSS sheet to restrict content width.
      * Add mild background color.
      * Restrict alphabetic indexes to 1 column.
      * Round corners of content boxes.
      * Rename example to CUDASaxpy.cpp.
      * Add CUDASaxpy.cpp to "Examples" section.
      
      Reviewers: jprice
      
      Subscribers: parallel_libs-commits
      
      Differential Revision: https://reviews.llvm.org/D24198
      
      llvm-svn: 280511
      1ce18561
    • Rui Ueyama's avatar
      Remove temoprary files. · fa12b8bd
      Rui Ueyama authored
      Previously, we created temporary files using llvm::sys::fs::createTemporaryFile
      and removed them using llvm::FileRemover. This is error-prone as it is easy to
      forget creating FileRemover instances after creating temporary files.
      There is actually a temporary file leak bug.
      
      This patch introduces a new class, TemporaryFile, to manage temporary files
      in the RAII style.
      
      Differential Revision: https://reviews.llvm.org/D24176
      
      llvm-svn: 280510
      fa12b8bd
    • Jason Henline's avatar
      [SE] GlobalDeviceMemory owns its handle · 31b88cb0
      Jason Henline authored
      Summary:
      Final step in getting GlobalDeviceMemory to own its handle.
      
      * Make GlobalDeviceMemory movable, but no longer copyable.
      * Make Device::freeDeviceMemory function private and make
        GlobalDeviceMemoryBase a friend of Device so GlobalDeviceMemoryBase
        can free its memory in its destructor.
      * Make GlobalDeviceMemory constructor private and make Device a friend
        so it can construct GlobalDeviceMemory.
      * Remove SharedDeviceMemoryBase class because it is never used.
      * Remove explicit memory freeing from example code.
      
      This change just consumes any errors generated during device memory freeing.
      The real error handling will be added in a future patch.
      
      Reviewers: jlebar
      
      Subscribers: jprice, parallel_libs-commits
      
      Differential Revision: https://reviews.llvm.org/D24195
      
      llvm-svn: 280509
      31b88cb0
    • Adam Nemet's avatar
      Fix up comment from r280442, noticed by Justin. · 26c43c87
      Adam Nemet authored
      llvm-svn: 280508
      26c43c87
    • Rui Ueyama's avatar
      Fix potential test failures. · 951cfb6a
      Rui Ueyama authored
      Windows does not allow opened files to be removed. This patch
      fixes two types of errors.
      
       - Output file being the same as input file. Because LLD itself
         holds a file descriptor of the input file, it cannot create an
         output file with the same name as a new file.
      
       - Removing files before releasing MemoryBuffer objects.
      
      These tests are not failing no because MemoryBuffer happens to
      decide not to use mmap on these files. But we shouldn't rely on
      that behavior.
      
      llvm-svn: 280507
      951cfb6a
    • Jason Henline's avatar
      [SE] Add "install" actions to cmake build · 75fbe01e
      Jason Henline authored
      The "install" build target will now copy the StreamExecutor library and
      headers to the appropriate subdirectories of CMAKE_INSTALL_PREFIX.
      
      llvm-svn: 280506
      75fbe01e
    • Wei Mi's avatar
      Split the store of a wide value merged from an int-fp pair into multiple stores. · c54d1298
      Wei Mi authored
      For the store of a wide value merged from a pair of values, especially int-fp pair,
      sometimes it is more efficent to split it into separate narrow stores, which can
      remove the bitwise instructions or sink them to colder places.
      
      Now the feature is only enabled on x86 target, and only store of int-fp pair is
      splitted. It is possible that the application scope gets extended with perf evidence
      support in the future.
      
      Differential Revision: https://reviews.llvm.org/D22840
      
      llvm-svn: 280505
      c54d1298
    • Sanjay Patel's avatar
      [InsttCombine] fold insertelement of constant into shuffle with constant operand (PR29126) · 521f19f2
      Sanjay Patel authored
      The motivating case occurs with SSE/AVX scalar intrinsics, so this is a first step towards
      shrinking that to a single shufflevector.
      
      Note that the transform is intentionally limited to shuffles that are equivalent to vector
      selects to avoid creating arbitrary shuffle masks that may not lower well.
      
      This should solve PR29126:
      https://llvm.org/bugs/show_bug.cgi?id=29126
      
      Differential Revision: https://reviews.llvm.org/D23886
      
      llvm-svn: 280504
      521f19f2
    • Davide Italiano's avatar
      [lib/LTO] Simplify. No functional change intended. · 41bfd6bd
      Davide Italiano authored
      llvm-svn: 280503
      41bfd6bd
    • Reid Kleckner's avatar
      Quick fix to make LIT_PRESERVES_TMP work again · 30e2067e
      Reid Kleckner authored
      llvm-svn: 280502
      30e2067e
    • Reid Kleckner's avatar
      [lit] Clean up temporary files created by tests · 8663b443
      Reid Kleckner authored
      Do this by creating a temp directory in the normal system temp
      directory, and cleaning it up on exit.
      
      It is still possible for this temp directory to leak if Python exits
      abnormally, but this is probably good enough for now.
      
      Fixes PR18335
      
      llvm-svn: 280501
      8663b443
    • Derek Schuff's avatar
      [WebAssembly] Update known test failures · a66ae923
      Derek Schuff authored
      Fixed an issue with the experimental C headers
      
      llvm-svn: 280498
      a66ae923
    • Matthew Simpson's avatar
      [LV] Ensure reverse interleaved group GEPs remain uniform · b65c230e
      Matthew Simpson authored
      For uniform instructions, we're only required to generate a scalar value for
      the first vector lane of each unroll iteration. Thus, if we have a reverse
      interleaved group, computing the member index off the scalar GEP corresponding
      to the last vector lane of its pointer operand technically makes the GEP
      non-uniform. We should compute the member index off the first scalar GEP
      instead.
      
      I've added the updated member index computation to the existing reverse
      interleaved group test.
      
      llvm-svn: 280497
      b65c230e
    • Jason Henline's avatar
      [SE] Don't pack raw device mem args · f26ef0a2
      Jason Henline authored
      Summary:
      Step 4 of getting GlobalDeviceMemory to own its handle.
      
      Take out code to pack untyped device memory types as kernel arguments.
      When GlobalDeviceMemory owns its handle, users will never touch untyped
      device memory types, so they will never pass them as kernel args.
      
      Reviewers: jlebar
      
      Subscribers: jprice, parallel_libs-commits
      
      Differential Revision: https://reviews.llvm.org/D24177
      
      llvm-svn: 280496
      f26ef0a2
    • George Rimar's avatar
      [ELF] - Linkerscript: add support for suffixes in numbers. · 9f2f7ad9
      George Rimar authored
      Both bfd and gold accept:
      foo = 1K;
      bar = 1M;
      zed = 1H;
      
      And lowercase forms: k, m, h.
      Patch adds support for that.
      
      Differential revision: https://reviews.llvm.org/D24194
      
      llvm-svn: 280494
      9f2f7ad9
    • Tamas Berghammer's avatar
      Fix build breakage caused by r280490 · 2a2712e0
      Tamas Berghammer authored
      llvm-svn: 280492
      2a2712e0
    • Andrea Di Biagio's avatar
      Simplify code a bit. No functional change intended. · bff3fd67
      Andrea Di Biagio authored
      We don't need to call `GetCompareTy(LHS)' every single time true or false is
      returned from function SimplifyFCmpInst as suggested by Sanjay in review D24142.
      
      llvm-svn: 280491
      bff3fd67
    • Tamas Berghammer's avatar
      Fix 2 waring in the OCaml AST context · 1d1613c9
      Tamas Berghammer authored
      llvm-svn: 280490
      1d1613c9
    • Sanjay Patel's avatar
      fix documentation comments; NFC · bd51c164
      Sanjay Patel authored
      llvm-svn: 280489
      bd51c164
    • Andrea Di Biagio's avatar
      [instsimplify] Fix incorrect folding of an ordered fcmp with a vector of all NaN. · 805815f4
      Andrea Di Biagio authored
      This patch fixes a crash caused by an incorrect folding of an ordered comparison
      between a packed floating point vector and a splat vector of NaN.
      
      An ordered comparison between a vector and a constant vector of NaN, should
      always be folded into a constant vector where each element is i1 false.
      
      Since revision 266175, SimplifyFCmpInst folds the ordered fcmp into a scalar
      'false'. Later on, this would cause an assertion failure, since the value type
      of the folded value doesn't match the expected value type of the uses of the
      original instruction: "Assertion failed: New->getType() == getType() &&
      "replaceAllUses of value with new value of different type!".
      
      This patch fixes the issue and adds a test case to the already existing test
      InstSimplify/floating-point-compares.ll.
      
      Differential Revision: https://reviews.llvm.org/D24143
      
      llvm-svn: 280488
      805815f4
    • Martin Probst's avatar
      clang-format: [JS] merge requoting replacements. · a9855afe
      Martin Probst authored
      Summary:
      When formatting source code that needs both requoting and reindentation,
      merge the replacements to avoid erroring out for conflicting replacements.
      
      Also removes the misleading Replacements parameter from the
      TokenAnalyzer API.
      
      Reviewers: djasper
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D24155
      
      llvm-svn: 280487
      a9855afe
    • Martin Probst's avatar
      clang-format: [JS] handle default bindings in imports. · 6918dcaf
      Martin Probst authored
      Summary:
      Default imports appear outside of named bindings in curly braces:
      
        import A from 'a';
        import A, {symbol} from 'a';
      
      Reviewers: djasper
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23973
      
      llvm-svn: 280486
      6918dcaf
    • Martin Probst's avatar
      clang-format: [JS] Sort all JavaScript imports if any changed. · b480ffbc
      Martin Probst authored
      Summary:
      User feedback is that they expect *all* imports to be sorted if any import was
      affected by a change, not just imports up to the first non-affected line, as
      clang-format currently does.
      
      Reviewers: djasper
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23972
      
      llvm-svn: 280485
      b480ffbc
    • Logan Chien's avatar
      [lit] Replace print with lit_config.note(). · 7a78e511
      Logan Chien authored
      This commit replaces print statement with lit_config.note().  This fixes
      python3 support for check-libcxxabi.
      
      llvm-svn: 280484
      7a78e511
    • Aaron Ballman's avatar
      Allow a C11 generic selection expression to select a function with the... · ff7bd8ba
      Aaron Ballman authored
      Allow a C11 generic selection expression to select a function with the overloadable attribute as the result expression without crashing. This fixes PR30201.
      
      llvm-svn: 280483
      ff7bd8ba
    • Andrea Di Biagio's avatar
      [DAGcombiner] Fix incorrect sinking of a truncate into the operand of a shift. · fd503e5a
      Andrea Di Biagio authored
      This fixes a regression introduced by revision 268094.
      Revision 268094 added the following dag combine rule:
      // trunc (shl x, K) -> shl (trunc x), K => K < vt.size / 2
      
      That rule converts a truncate of a shift-by-constant into a shift of a truncated
      value. We do this only if the shift count is less than half the size in bits of
      the truncated value (K < vt.size / 2).
      
      The problem is that the constraint on the shift count is incorrect, so the rule
      doesn't work well in some cases involving vector types. The combine rule should
      have been written instead like this:
      // trunc (shl x, K) -> shl (trunc x), K => K < vt.getScalarSizeInBits()
      
      Basically, if K is smaller than the "scalar size in bits" of the truncated value
      then we know that by "sinking" the truncate into the operand of the shift we
      would never accidentally make the shift undefined.
      
      This patch fixes the check on the shift count, and adds test cases to make sure
      that we don't regress the behavior.
      
      Differential Revision: https://reviews.llvm.org/D24154
      
      llvm-svn: 280482
      fd503e5a
    • Andrey Bokhanko's avatar
      Fixed a typo (LLVM/Support/CFG.h -> LLVM/IR/CFG.h) · 74541457
      Andrey Bokhanko authored
      llvm-svn: 280481
      74541457
Loading