1. Aug 25, 2014
  2. Aug 24, 2014
    • Aaron Ballman's avatar
      This code is from r216285, which did not go out to the mailing list for some reason. · 9d515ff6
      Aaron Ballman authored
      The switch statement would never fire due to the preceding break statement. Also, the switch statement has a default label with no case labels. Simplified the code, and allow it to execute.
      
      llvm-svn: 216346
      9d515ff6
    • Elena Demikhovsky's avatar
      X86 intrinsics table - simplifies intrinsics lowering. · 22e735d7
      Elena Demikhovsky authored
      The tables are initialized when X86TargetLowering object is created.
      
      llvm-svn: 216345
      22e735d7
    • Patrik Hagglund's avatar
      Silence gcc -Wpedantic. · 3e2a9d61
      Patrik Hagglund authored
      llvm-svn: 216344
      3e2a9d61
    • David Majnemer's avatar
      InstCombine: Properly optimize or'ing bittests together · 0ffccf7f
      David Majnemer authored
      CFE, with -03, would turn:
      bool f(unsigned x) {
        bool a = x & 1;
        bool b = x & 2;
        return a | b;
      }
      
      into:
        %1 = lshr i32 %x, 1
        %2 = or i32 %1, %x
        %3 = and i32 %2, 1
        %4 = icmp ne i32 %3, 0
      
      This sort of thing exposes a nasty pathology in GCC, ICC and LLVM.
      
      Instead, we would rather want:
        %1 = and i32 %x, 3
        %2 = icmp ne i32 %1, 0
      
      Things get a bit more interesting in the following case:
        %1 = lshr i32 %x, %y
        %2 = or i32 %1, %x
        %3 = and i32 %2, 1
        %4 = icmp ne i32 %3, 0
      
      Replacing it with the following sequence is better:
        %1 = shl nuw i32 1, %y
        %2 = or i32 %1, 1
        %3 = and i32 %2, %x
        %4 = icmp ne i32 %3, 0
      
      This sequence is preferable because %1 doesn't involve %x and could
      potentially be hoisted out of loops if it is invariant; only perform
      this transform in the non-constant case if we know we won't increase
      register pressure.
      
      llvm-svn: 216343
      0ffccf7f
    • Hal Finkel's avatar
      Move __vector long deprecation checking into DeclSpec::Finish · 3a1f4c77
      Hal Finkel authored
      __vector long is deprecated, but __vector long long is not. As a result, we
      cannot check for __vector long (to issue the deprecation warning) as we parse
      the type because we need to know how many 'long's we have first.
      DeclSpec::Finish seems like a more-appropriate place to perform the check
      (which places it with several other similar Altivec vector checks).
      
      Fixes PR20720.
      
      llvm-svn: 216342
      3a1f4c77
    • Hal Finkel's avatar
      Implement __builtin_signbitl for PowerPC · 62082519
      Hal Finkel authored
      PowerPC uses the special PPC_FP128 type for long double on Linux, which is
      composed of two 64-bit doubles. The higher-order double (which contains the
      overall sign) comes first, and so the __builtin_signbitl implementation
      requires special handling to extract the sign bit.
      
      Fixes PR20691.
      
      llvm-svn: 216341
      62082519
    • Hans Wennborg's avatar
      Don't assert on different DLL attributes in template and explicit instantiation (PR20137) · c2b7f7a6
      Hans Wennborg authored
      We would previously assert (a decl cannot have two DLL attributes) on this code:
      
        template <typename T> struct __declspec(dllimport) S { T f() { return T(); } };
        template struct __declspec(dllexport) S<int>;
      
      The problem was that when instantiating, we would take the attribute from the
      template even if the instantiation itself already had an attribute.
      
      Also, don't inherit DLL attributes from the template to its members before
      instantiation, as the attribute may change.
      
      I couldn't figure out what MinGW does here, so I'm leaving that open. At least
      we're not asserting anymore.
      
      llvm-svn: 216340
      c2b7f7a6
    • Hal Finkel's avatar
      [PowerPC] Add support for dcbtst and icbt (prefetch) · 584a70c8
      Hal Finkel authored
      Adds code generation support for dcbtst (data cache prefetch for write) and
      icbt (instruction cache prefetch for read - Book E cores only).
      
      We still end up with a 'cannot select' error for the non-supported prefetch
      intrinsic forms. This will be fixed in a later commit.
      
      Fixes PR20692.
      
      llvm-svn: 216339
      584a70c8
    • Dylan Noblesmith's avatar
      Support: add llvm::unique_lock · c4c5180f
      Dylan Noblesmith authored
      Based on the STL class of the same name, it guards a mutex
      while also allowing it to be unlocked conditionally before
      destruction.
      
      This eliminates the last naked usages of mutexes in LLVM and
      clang.
      
      It also uncovered and fixed a bug in callExternalFunction()
      when compiled without USE_LIBFFI, where the mutex would never
      be unlocked if the end of the function was reached.
      
      llvm-svn: 216338
      c4c5180f
    • Hans Wennborg's avatar
      ffb55639
    • Dylan Noblesmith's avatar
      Support: make LLVM Mutexes STL-compatible · 13044d1c
      Dylan Noblesmith authored
      Use lock/unlock() convention instead of acquire/release().
      
      llvm-svn: 216336
      13044d1c
    • Dylan Noblesmith's avatar
      Support/Unix: use ScopedLock wherever possible · 4704ffe1
      Dylan Noblesmith authored
      Only one function remains a bit too complicated
      for a simple mutex guard. No functionality change.
      
      llvm-svn: 216335
      4704ffe1
    • Hans Wennborg's avatar
    • Hans Wennborg's avatar
      205c39bb
    • Keno Fischer's avatar
      Resurect preprocessor definitions that got lost moving to HostInfo · 5777edf0
      Keno Fischer authored
      When building without XCode on sytems where these constants are
      not in the system header (or I presume with older versions of XCode),
      these are needed to make this file compile, since unlike most other
      uses of MachO specific constants, these use the system headers
      rather than the LLVM-defined ones.
      
      llvm-svn: 216332
      5777edf0
    • Dylan Noblesmith's avatar
      cmake: actually test -Wcomment · 63f9b571
      Dylan Noblesmith authored
      This test was testing nothing, as only -Werror was ever
      being added to the compiler flags.
      
      You can see the final nitty-gritty compiler invocation in
      CMakeFiles/CMakeOutput.log (for successful tests) and
      CMakeFiles/CMakeError.log (for failed tests).
      
      Before:
      Building C object CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o
      /usr/bin/clang   -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default  -DC_WCOMMENT_ALLOWS_LINE_WRAP  -Werror   -o CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o   -c /home/nobled/code/llvm-b9/CMakeFiles/CMakeTmp/src.c
      
      After:
      Building C object CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o
      /usr/bin/clang   -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default  -DC_WCOMMENT_ALLOWS_LINE_WRAP  -Werror -Wcomment   -o CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o   -c /home/nobled/code/llvm-b9/CMakeFiles/CMakeTmp/src.c
      
      llvm-svn: 216328
      63f9b571
    • Dylan Noblesmith's avatar
      cmake: disable -Wnon-virtual-dtor when it gives false positives · 367cef63
      Dylan Noblesmith authored
      clang has only been smart enough not to trigger -Wnon-virtual-dtor
      warnings on final classes since r208449 (in clang 3.5). Building
      with older versions is extremely noisy, so disable the warning
      on those compilers.
      
      llvm-svn: 216327
      367cef63
    • Hans Wennborg's avatar
      checkDLLAttribute: remove a redundant dyn_cast · 2f9e293e
      Hans Wennborg authored
      The same dyn_cast was done earlier in the function. No functionality change.
      
      llvm-svn: 216326
      2f9e293e
    • Chad Rosier's avatar
      Revert "ARM: improve RTABI 4.2 conformance on Linux" · ad7c910e
      Chad Rosier authored
      This reverts commit r215862 due to nightly failures.  Will work on getting a
      reduced test case, but I wanted to get our bots green in the meantime.
      
      llvm-svn: 216325
      ad7c910e
    • Chad Rosier's avatar
      Revert "ARM: mark missing functions from RTABI" · d2959362
      Chad Rosier authored
      This reverts commit r215863.
      
      llvm-svn: 216324
      d2959362
    • Enrico Granata's avatar
      I forgot to include the header file for std::find, and that's breaking the... · 9f1d3363
      Enrico Granata authored
      I forgot to include the header file for std::find, and that's breaking the Linux build. Push a fix out. Patch suggested by Paul Osmialowski and Randy Smith
      
      llvm-svn: 216323
      9f1d3363
  3. Aug 23, 2014
    • Aaron Watry's avatar
      Revert "Implement generic mad_sat" · 94470976
      Aaron Watry authored
      This reverts commit cf62eded8b623a1c10d3692d25e5882b7939f564.
      
      I didn't mean to commit this...  Jan has a v3 incoming
      
      llvm-svn: 216322
      94470976
    • Aaron Watry's avatar
      Add int3/uint3 to integer-gentype.inc · a4fdda01
      Aaron Watry authored
      
      
      These were missing and caused mad24/mul24 with int3/uint3 arg type to fail
      
      Signed-off-by: default avatarAaron Watry <awatry@gmail.com>
      Reviewed-by: default avatarTom Stellard <thomas.stellard@amd.com>
      llvm-svn: 216321
      a4fdda01
    • Aaron Watry's avatar
      Implement generic mad_sat · 6bfac7ae
      Aaron Watry authored
      v2: Fix trailing whitespace
          Fix signed long overflow
          improve comment
      
      Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
      llvm-svn: 216320
      6bfac7ae
    • Chandler Carruth's avatar
      [x86] Start fixing a really subtle and terrible form of miscompile in · a15258b4
      Chandler Carruth authored
      these DAG combines.
      
      The DAG auto-CSE thing is truly terrible. Due to it, when RAUW-ing
      a node with its operand, you can cause its uses to CSE to itself, which
      then causes their uses to become your uses which causes them to be
      picked up by the RAUW. For nodes that are determined to be "no-ops",
      this is "fine". But if the RAUW is one of several steps to enact
      a transformation, this causes the DAG to really silently eat an discard
      nodes that you would never expect. It took days for me to actually
      pinpoint a test case triggering this and a really frustrating amount of
      time to even comprehend the bug because I never even thought about the
      ability of RAUW to iteratively consume nodes due to CSE-ing them into
      itself.
      
      To fix this, we have to build up a brand-new chain of operations any
      time we are combining across (potentially) intervening nodes. But once
      the logic is added to do this, another issue surfaces: CombineTo eagerly
      deletes the one node combined, *but no others*. This is... really
      frustrating. If deleting it makes its operands become dead, those
      operand nodes often won't go onto the worklist in the
      order you would want -- they're already on it and not near the top. That
      means things higher on the worklist will get combined prior to these
      dead nodes being GCed out of the worklist, and if the chain is long, the
      immediate users won't be enough to re-detect where the root of the chain
      is that became single-use again after deleting the dead nodes. The
      better way to do this is to never immediately delete nodes, and instead
      to just enqueue them so we can recursively delete them. The
      combined-from node is typically not on the worklist anyways by virtue of
      having been popped off.... But that in turn breaks other tests that
      *require* CombineTo to delete unused nodes. :: sigh ::
      
      Fortunately, there is a better way. This whole routine should have been
      returning the replacement rather than using CombineTo which is quite
      hacky. Switch to that, and all the pieces fall together.
      
      I suspect the same kind of miscompile is possible in the half-shuffle
      folding code, and potentially the recursive folding code. I'll be
      switching those over to a pattern more like this one for safety's sake
      even though I don't immediately have any test cases for them. Note that
      the only way I got a test case for this instance was with *heavily* DAG
      combined 256-bit shuffle sequences generated by my fuzzer. ;]
      
      llvm-svn: 216319
      a15258b4
    • Eric Fiselier's avatar
      Fix assignments that should be comparisons x3 · 1f7bd5f2
      Eric Fiselier authored
      llvm-svn: 216318
      1f7bd5f2
    • Eric Fiselier's avatar
    • Hans Wennborg's avatar
      ProgrammersManual: the flag is called -debug-only · 9a01309b
      Hans Wennborg authored
      llvm-svn: 216316
      9a01309b
    • Eric Fiselier's avatar
      [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default LIT args. · 916223b6
      Eric Fiselier authored
      Summary:
      In order to gather more information about testsuite results these flags should be added to LIT's default args.
      These new switches were recently added to LIT. It been more than two weeks since both switches were added.
      I think its time we add these to our LIT flags.
      
      
      Reviewers: mclow.lists, danalbert
      
      Reviewed By: danalbert
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D5037
      
      llvm-svn: 216315
      916223b6
    • Eric Fiselier's avatar
      Fix handling of format strings to work with python 2.6 · 561dfb57
      Eric Fiselier authored
      llvm-svn: 216314
      561dfb57
    • David Majnemer's avatar
      CodeGen: Skip unnamed bitfields when handling designated initializers · 58e4ea90
      David Majnemer authored
      We would accidently initialize unnamed bitfields instead of the
      following field.
      
      llvm-svn: 216313
      58e4ea90
    • Richard Smith's avatar
      [modules] When merging a tag declaration that has a typedef name for linkage · 88ebade8
      Richard Smith authored
      purposes, look for other typedefs with that same name and merge into their
      named tag declaration if there is one.
      
      llvm-svn: 216312
      88ebade8