1. Jul 11, 2015
    • Sean Callanan's avatar
      Fixed a problem where variables in modules were not appropriately discovered by · 9ff456c8
      Sean Callanan authored
      the expression parser.
      
      <rdar://problem/21395220>
      
      llvm-svn: 241917
      9ff456c8
    • Ulrich Weigand's avatar
      Respect alignment of nested bitfields · 03ce2a16
      Ulrich Weigand authored
      tools/clang/test/CodeGen/packed-nest-unpacked.c contains this test:
      
      struct XBitfield {
        unsigned b1 : 10;
        unsigned b2 : 12;
        unsigned b3 : 10;
      };
      struct YBitfield {
        char x;
        struct XBitfield y;
      } __attribute((packed));
      struct YBitfield gbitfield;
      
      unsigned test7() {
        // CHECK: @test7
        // CHECK: load i32, i32* getelementptr inbounds (%struct.YBitfield, %struct.YBitfield* @gbitfield, i32 0, i32 1, i32 0), align 4
        return gbitfield.y.b2;
      }
      
      The "align 4" is actually wrong.  Accessing all of "gbitfield.y" as a single
      i32 is of course possible, but that still doesn't make it 4-byte aligned as
      it remains packed at offset 1 in the surrounding gbitfield object.
      
      This alignment was changed by commit r169489, which also introduced changes
      to bitfield access code in CGExpr.cpp.  Code before that change used to take
      into account *both* the alignment of the field to be accessed within the
      current struct, *and* the alignment of that outer struct itself; this logic
      was removed by the above commit.
      
      Neglecting to consider both values can cause incorrect code to be generated
      (I've seen an unaligned access crash on SystemZ due to this bug).
      
      In order to always use the best known alignment value, this patch removes
      the CGBitFieldInfo::StorageAlignment member and replaces it with a
      StorageOffset member specifying the offset from the start of the surrounding
      struct to the bitfield's underlying storage.  This offset can then be combined
      with the best-known alignment for a bitfield access lvalue to determine the
      alignment to use when accessing the bitfield's storage.
      
      Differential Revision: http://reviews.llvm.org/D11034
      
      llvm-svn: 241916
      03ce2a16
  2. Jul 10, 2015
    • Adrian Prantl's avatar
      Add a missing dependency to unittests/Frontend. · 9b82de78
      Adrian Prantl authored
      PR24067.
      
      llvm-svn: 241915
      9b82de78
    • Eli Bendersky's avatar
      Actually support volatile memcpys in NVPTX lowering · 5c0039a0
      Eli Bendersky authored
      Differential Revision: http://reviews.llvm.org/D11091
      
      llvm-svn: 241914
      5c0039a0
    • Nemanja Ivanovic's avatar
      NFC. Added a blank line for consistency. · d9e4b4ff
      Nemanja Ivanovic authored
      llvm-svn: 241913
      d9e4b4ff
    • Nemanja Ivanovic's avatar
      672a1476
    • Benjamin Kramer's avatar
      [InstSimplify] Fold away ord/uno fcmps when nnan is present. · f4ebfa3a
      Benjamin Kramer authored
      This is important to fold away the slow case of complex multiplies
      emitted by clang.
      
      llvm-svn: 241911
      f4ebfa3a
    • Daniel Jasper's avatar
      clang-format: [JS] Assign proper penalties when breaking a type annotation · b9a52814
      Daniel Jasper authored
      Before:
        class Test {
          aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa:
                               aaaaaaaaaaaaaaaaaaaaaaaa): aaaaaaaaaaaaaaaaaaaaaa {}
        }
      
      After:
        class Test {
          aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaa):
              aaaaaaaaaaaaaaaaaaaaaa {}
        }
      
      llvm-svn: 241908
      b9a52814
    • Tom Stellard's avatar
      R600: Implement accurate double precision sqrt v2 · 4f8d2623
      Tom Stellard authored
      v2:
        - Use same implementation for R600 and gcn.
      
      llvm-svn: 241907
      4f8d2623
    • Tom Stellard's avatar
      Fix implementation of sqrt v2 · 2ef5ec6b
      Tom Stellard authored
      Passing values less than 0 to the llvm.sqrt() intrinsic results in
      undefined behavior, so we need to check the input and return NaN if
      is is less than 0.
      
      v2:
        - Fix build failures.
      
      llvm-svn: 241906
      2ef5ec6b
    • Tom Stellard's avatar
      prepare-builtins: Fix build with LLVM 3.6 · 0e4152e3
      Tom Stellard authored
      Patch by: Tomasz Borowik
      
      llvm-svn: 241905
      0e4152e3
    • Nemanja Ivanovic's avatar
      Add missing builtins to altivec.h for ABI compliance (vol. 3) · 26c3534b
      Nemanja Ivanovic authored
      This patch corresponds to review:
      http://reviews.llvm.org/D10972
      
      Fix for the handling of dependent features that are enabled by default
      on some CPU's (such as -mvsx, -mpower8-vector).
      
      Also provides a number of new interfaces or fixes existing ones in
      altivec.h.
      
      Changed signatures to conform to ABI:
      vector short vec_perm(vector signed short, vector signed short, vector unsigned char)
      vector int vec_perm(vector signed int, vector signed int, vector unsigned char)
      vector long long vec_perm(vector signed long long, vector signed long long, vector unsigned char)
      vector signed char vec_sld(vector signed char, vector signed char, const int)
      vector unsigned char vec_sld(vector unsigned char, vector unsigned char, const int)
      vector bool char vec_sld(vector bool char, vector bool char, const int)
      vector unsigned short vec_sld(vector unsigned short, vector unsigned short, const int)
      vector signed short vec_sld(vector signed short, vector signed short, const int)
      vector signed int vec_sld(vector signed int, vector signed int, const int)
      vector unsigned int vec_sld(vector unsigned int, vector unsigned int, const int)
      vector float vec_sld(vector float, vector float, const int)
      vector signed char vec_splat(vector signed char, const int)
      vector unsigned char vec_splat(vector unsigned char, const int)
      vector bool char vec_splat(vector bool char, const int)
      vector signed short vec_splat(vector signed short, const int)
      vector unsigned short vec_splat(vector unsigned short, const int)
      vector bool short vec_splat(vector bool short, const int)
      vector pixel vec_splat(vector pixel, const int)
      vector signed int vec_splat(vector signed int, const int)
      vector unsigned int vec_splat(vector unsigned int, const int)
      vector bool int vec_splat(vector bool int, const int)
      vector float vec_splat(vector float, const int)
      
      Added a VSX path to:
      vector float vec_round(vector float)
      
      Added interfaces:
      vector signed char vec_eqv(vector signed char, vector signed char)
      vector signed char vec_eqv(vector bool char, vector signed char)
      vector signed char vec_eqv(vector signed char, vector bool char)
      vector unsigned char vec_eqv(vector unsigned char, vector unsigned char)
      vector unsigned char vec_eqv(vector bool char, vector unsigned char)
      vector unsigned char vec_eqv(vector unsigned char, vector bool char)
      vector signed short vec_eqv(vector signed short, vector signed short)
      vector signed short vec_eqv(vector bool short, vector signed short)
      vector signed short vec_eqv(vector signed short, vector bool short)
      vector unsigned short vec_eqv(vector unsigned short, vector unsigned short)
      vector unsigned short vec_eqv(vector bool short, vector unsigned short)
      vector unsigned short vec_eqv(vector unsigned short, vector bool short)
      vector signed int vec_eqv(vector signed int, vector signed int)
      vector signed int vec_eqv(vector bool int, vector signed int)
      vector signed int vec_eqv(vector signed int, vector bool int)
      vector unsigned int vec_eqv(vector unsigned int, vector unsigned int)
      vector unsigned int vec_eqv(vector bool int, vector unsigned int)
      vector unsigned int vec_eqv(vector unsigned int, vector bool int)
      vector signed long long vec_eqv(vector signed long long, vector signed long long)
      vector signed long long vec_eqv(vector bool long long, vector signed long long)
      vector signed long long vec_eqv(vector signed long long, vector bool long long)
      vector unsigned long long vec_eqv(vector unsigned long long, vector unsigned long long)
      vector unsigned long long vec_eqv(vector bool long long, vector unsigned long long)
      vector unsigned long long vec_eqv(vector unsigned long long, vector bool long long)
      vector float vec_eqv(vector float, vector float)
      vector float vec_eqv(vector bool int, vector float)
      vector float vec_eqv(vector float, vector bool int)
      vector double vec_eqv(vector double, vector double)
      vector double vec_eqv(vector bool long long, vector double)
      vector double vec_eqv(vector double, vector bool long long)
      vector bool long long vec_perm(vector bool long long, vector bool long long, vector unsigned char)
      vector double vec_round(vector double)
      vector double vec_splat(vector double, const int)
      vector bool long long vec_splat(vector bool long long, const int)
      vector signed long long vec_splat(vector signed long long, const int)
      vector unsigned long long vec_splat(vector unsigned long long,
      vector bool int vec_sld(vector bool int, vector bool int, const int)
      vector bool short vec_sld(vector bool short, vector bool short, const int)
      
      llvm-svn: 241904
      26c3534b
    • NAKAMURA Takumi's avatar
      ddb44b85
    • Benjamin Kramer's avatar
      0429b7ae
    • James Molloy's avatar
      Add support for fast-math flags to the FCmp instruction. · 88eb535b
      James Molloy authored
      FCmp behaves a lot like a floating-point binary operator in many ways,
      and can benefit from fast-math information. Flags such as nsz and nnan
      can affect if this fcmp (in combination with a select) can be treated
      as a fminnum/fmaxnum operation.
      
      This adds backwards-compatible bitcode support, IR parsing and writing,
      LangRef changes and IRBuilder changes. I'll need to audit InstSimplify
      and InstCombine in a followup to find places where flags should be
      copied.
      
      llvm-svn: 241901
      88eb535b
    • Nemanja Ivanovic's avatar
      Add missing builtins to the PPC back end for ABI compliance (vol. 3) · 5655fb32
      Nemanja Ivanovic authored
      This patch corresponds to review:
      http://reviews.llvm.org/D10973
      
      Back end portion of the third round of additions to altivec.h.
      
      llvm-svn: 241900
      5655fb32
    • Benjamin Kramer's avatar
      Reapply test for r241811 with a fix for msvc compat mode. · 3cfdf204
      Benjamin Kramer authored
      Delayed template parsing interferes with code completion, just distable it for
      this test. This reverts r241811.
      
      llvm-svn: 241899
      3cfdf204
    • Ulrich Weigand's avatar
      Respect alignment when loading up a coerced function argument · 6e2cea6f
      Ulrich Weigand authored
      Code in CGCall.cpp that loads up function arguments that need to be
      coerced to a different type may in some cases ignore the fact that
      the source of the argument is not naturally aligned. This may cause
      incorrect code to be generated. In some places in CreateCoercedLoad,
      we already have setAlignment calls to address this, but I ran into one
      where it was missing, causing wrong code generation on SystemZ.
      
      However, in that location, we do not actually know what alignment of
      the source location we can rely on; the callers do not pass anything
      to this routine. This is already an issue in other places in
      CreateCoercedLoad; and the same problem exists for CreateCoercedStore.
      
      To avoid pessimising code, and to fix the FIXMEs already in place,
      this patch also adds an alignment argument to the CreateCoerced*
      routines and uses it instead of forcing an alignment of 1. The
      callers are changed to pass in the best information they have.
      
      This actually requires changes in a number of existing test cases
      since we now get better alignment in many places.
      
      Differential Revision: http://reviews.llvm.org/D11033
      
      llvm-svn: 241898
      6e2cea6f
    • Alexey Bataev's avatar
      Disable loop re-rotation for -Oz (patch by Andrey Turetsky) · da33d80e
      Alexey Bataev authored
      After changes in rL231820 loop re-rotation is performed even in -Oz mode. Since loop rotation is disabled for -Oz, it seems loop re-rotation should be disabled too.
      Differential Revision: http://reviews.llvm.org/D10961
      
      llvm-svn: 241897
      da33d80e
    • Pawel Bylica's avatar
      [llvm-stress] Enhance scalar type selection from command line. · edb0210c
      Pawel Bylica authored
      llvm-stress command line options like -generate-x86-fp80 has been replaced with one list-like option -types. E.g. llvm-stress -types=x86_fp80,i100,i256,half. Default types (i1, i8, i16, i32, i64, float, double) are always added at the beginning of that list.
      
      Reviewers: hfinkel
      
      Differential Revision: http://reviews.llvm.org/D10667
      
      llvm-svn: 241896
      edb0210c
    • NAKAMURA Takumi's avatar
      llvm/Object/ELF.h: Appease g++-4.7.2. · 9ca122f0
      NAKAMURA Takumi authored
      llvm-svn: 241895
      9ca122f0
    • Daniel Jasper's avatar
      Re-use a single SmallString instance to reduce the stack frame size · 7450f917
      Daniel Jasper authored
      In certain builds (msan), this can otherwise exceed the stack frame
      limit set for certain environments.
      
      llvm-svn: 241894
      7450f917
    • David Majnemer's avatar
      Revert the new EH instructions · db82d2f3
      David Majnemer authored
      This reverts commits r241888-r241891, I didn't mean to commit them.
      
      llvm-svn: 241893
      db82d2f3
    • Daniel Jasper's avatar
      Add missing 'const'. I don't think this is strictly required, but some · 0f70ee90
      Daniel Jasper authored
      compiler configuration is giving me an error and it seems to be
      recommended anyway.
      
      llvm-svn: 241892
      0f70ee90
    • David Majnemer's avatar
      Tighten the verifier check for catchblock. · 82771b1a
      David Majnemer authored
      llvm-svn: 241891
      82771b1a
    • David Majnemer's avatar
      Address Joseph's review comments. · 11aeb90a
      David Majnemer authored
      llvm-svn: 241890
      11aeb90a
    • David Majnemer's avatar
      Address Reid's review feedback. · 1d3fe98d
      David Majnemer authored
      llvm-svn: 241889
      1d3fe98d
    • David Majnemer's avatar
      New EH representation for MSVC compatibility · ae2ffc8a
      David Majnemer authored
      Summary:
      This introduces new instructions neccessary to implement MSVC-compatible
      exception handling support.  Most of the middle-end and none of the
      back-end haven't been audited or updated to take them into account.
      
      Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D11041
      
      llvm-svn: 241888
      ae2ffc8a
    • Bjorn Steinbrink's avatar
      [InstCombine] Employ AliasAnalysis in FindAvailableLoadedValue · 83505347
      Bjorn Steinbrink authored
      llvm-svn: 241887
      83505347
    • Bjorn Steinbrink's avatar
      [InstCombine] Properly combine metadata when replacing a load with another · a91fd099
      Bjorn Steinbrink authored
      Not doing this can lead to misoptimizations down the line, e.g. because
      of range metadata on the replacing load excluding values that are valid
      for the load that is being replaced.
      
      llvm-svn: 241886
      a91fd099
    • Daniel Jasper's avatar
      Remove test that tests referring to the current working directory. You · 7dc6b500
      Daniel Jasper authored
      cannot assume that the current working directory is writable in all test
      environments. I don't know a better way to write this test of hand, lets
      discuss. Possibly, a better option would be to put these together with
      other test testing the driver directly.
      
      llvm-svn: 241885
      7dc6b500
    • Jingyue Wu's avatar
      [NVPTX] declare no vector registers · ad85c8c2
      Jingyue Wu authored
      Summary:
      Without this patch, LoopVectorizer in certain cases (see loop-vectorize.ll)
      produces code with complex control flow which hurts later optimizations. Since
      NVPTX doesn't have vector registers in LLVM's sense
      (NVPTXTTI::getRegisterBitWidth(true) == 32), we for now declare no vector
      registers to effectively disable loop vectorization.
      
      Reviewers: jholewinski
      
      Subscribers: jingyue, llvm-commits, jholewinski
      
      Differential Revision: http://reviews.llvm.org/D11089
      
      llvm-svn: 241884
      ad85c8c2
    • Rui Ueyama's avatar
      COFF: Fix locally-imported symbol's base relocations. · c851ccc3
      Rui Ueyama authored
      Base relocations are RVA and not VA, so we shouldn't add ImageBase.
      
      llvm-svn: 241883
      c851ccc3
    • NAKAMURA Takumi's avatar
      Revert test lines added in r241811, "[CodeCompletion] Don't crash on member... · 0de292f5
      NAKAMURA Takumi authored
      Revert test lines added in r241811, "[CodeCompletion] Don't crash on member inits of templated constructors.", for now.
      
      It doesn't pass for targeting MS mode.
      
      llvm-svn: 241882
      0de292f5
    • Peter Collingbourne's avatar
      Driver: Make all of -f{,no-}sanitize{,-recover,-trap} core options. · 49572174
      Peter Collingbourne authored
      This allows them to be used from clang-cl.
      
      llvm-svn: 241881
      49572174
    • John Thompson's avatar
      Added mechanism to modularize for doing a compilation precheck · 4018c624
      John Thompson authored
      to determine files that have comnpilation or dependency problems.
      A new -display-file-lists option use this to display lists of good files
      (no compile errors), problem files, and a combined list with
      problem files preceded by a '#'.  The problem files list can be
      used in the module map generation assistant mode to exclude
      problem files.  The combined files list can be used during module
      map development.  See added docs.
      
      llvm-svn: 241880
      4018c624
    • Greg Clayton's avatar
      Don't let a test fail because of a teardown command returning an error. Use a... · fdbff2af
      Greg Clayton authored
      Don't let a test fail because of a teardown command returning an error. Use a function that doesn't check the return value.
      
      llvm-svn: 241879
      fdbff2af
    • Reid Kleckner's avatar
      Re-enable 32-bit SEH after the alignment fix · 8819a406
      Reid Kleckner authored
      llvm-svn: 241878
      8819a406
    • Reid Kleckner's avatar
      [WinEH] Make sure LSDA tables are 4 byte aligned · 85a2450d
      Reid Kleckner authored
      Apparently this is important, otherwise _except_handler3 assumes that
      the registration node is corrupted and ignores it.
      
      Also fix a bug in WinEHPrepare where we would insert code after a
      terminator instruction.
      
      llvm-svn: 241877
      85a2450d
    • Alexey Samsonov's avatar