Commit Graph

244402 Commits

Author SHA1 Message Date
Kostya Serebryany a09d11e108 [libFuzzer] refactoring to speed things up, NFC
llvm-svn: 283946
2016-10-11 21:27:37 +00:00
Marshall Clow 66e63793e7 Remove extraneous 'const' in the implementation of is_move_assignable. Howard pleads temporary insanity about this. Discussed at http://stackoverflow.com/questions/39986185
llvm-svn: 283945
2016-10-11 21:24:06 +00:00
Eric Fiselier 9595fb21dd Fix std::pair on FreeBSD
Summary:
FreeBSD ships an old ABI for std::pair which requires that it have non-trivial copy/move constructors. Currently the non-trivial copy/move is achieved by providing explicit definitions of the constructors. This is problematic because it means the constructors don't SFINAE properly. In order to SFINAE copy/move constructors they have to be explicitly defaulted and hense non-trivial.

This patch attempts to provide SFINAE'ing copy/move constructors for std::pair while still making them non-trivial. It does this by adding a base class with a non-trivial copy constructor and then allowing pair's constructors to be generated by the compiler. This also allows the constructors to be constexpr.


Reviewers: emaste, theraven, rsmith, dim

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25389

llvm-svn: 283944
2016-10-11 21:22:21 +00:00
Manman Ren a58f92f09d Module: for ObjectiveC, be consistent when checking hidden decls.
In MatchAllMethodDeclarations, when checking a hidden decl, be sure
to allow hidden when searching for methods.

rdar://28699972

llvm-svn: 283943
2016-10-11 21:18:20 +00:00
Reid Kleckner bdfc05ff93 Re-land "[Thumb] Save/restore high registers in Thumb1 pro/epilogues"
Reverts r283938 to reinstate r283867 with a fix.

The original change had an ArrayRef referring to a destroyed temporary
initializer list. Use plain C arrays instead.

llvm-svn: 283942
2016-10-11 21:14:03 +00:00
Eric Fiselier e778d10c0f Fix incorrect exception handling behavior in the uninitialized algorithms
llvm-svn: 283941
2016-10-11 21:13:44 +00:00
Jim Ingham 7d84aff200 Add the radar number on our end.
llvm-svn: 283940
2016-10-11 21:08:27 +00:00
Kevin Enderby 68fffa8a62 Next set of additional error checks for invalid Mach-O files for the
load commands that uses the MachO::linker_option_command
type but not used in llvm libObject code but used in llvm tool code.

This includes just LC_LINKER_OPTION load command.

llvm-svn: 283939
2016-10-11 21:04:39 +00:00
Reid Kleckner f4876beb2b Revert "[Thumb] Save/restore high registers in Thumb1 pro/epilogues"
This reverts r283867.

This appears to be an infinite loop:

    while (HiRegToSave != AllHighRegs.end() && CopyReg != AllCopyRegs.end()) {
      if (HiRegsToSave.count(*HiRegToSave)) {
        ...

        CopyReg = findNextOrderedReg(++CopyReg, CopyRegs, AllCopyRegs.end());
        HiRegToSave =
            findNextOrderedReg(++HiRegToSave, HiRegsToSave, AllHighRegs.end());
      }
    }

llvm-svn: 283938
2016-10-11 20:54:41 +00:00
Tim Northover 3d38b3a4d1 GlobalISel: support selection of extend operations.
Patch mostly by Ahmed Bougaca.

llvm-svn: 283937
2016-10-11 20:50:21 +00:00
Tim Northover 60cf6fc58f MIRParser: allow types on registers with a RegBank.
This fixes some GlobalISel regression tests.

llvm-svn: 283936
2016-10-11 20:50:04 +00:00
Jordan Rose 764f9f7806 Re-apply "Disallow ArrayRef assignment from temporaries."
This re-applies r283798, disabled in r283803, with the static_assert
tests disabled under MSVC. The deleted functions still seem to catch
mistakes in MSVC, so it's not a significant loss.

Part of rdar://problem/16375365

llvm-svn: 283935
2016-10-11 20:39:16 +00:00
Kyle Butt 0846e56e63 Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well. Issue was worklist/scheduling/taildup issue in layout.

Issue from 2nd rollback fixed, with 2 additional tests. Issue was
tail merging/loop info/tail-duplication causing issue with loops that share
a header block.

Issue with early tail-duplication of blocks that branch to a fallthrough
predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll

Differential revision: https://reviews.llvm.org/D18226

llvm-svn: 283934
2016-10-11 20:36:43 +00:00
Arnold Schwaighofer 5bb08d8f5a Swift Calling Convention: Parameters are allowed after the
swift_error/swift_context parameter

We need to be able to decelare witness functions which append the self type and
the self witness tables at the end of the parameter list.

rdar://28720996

llvm-svn: 283933
2016-10-11 20:34:06 +00:00
Arnold Schwaighofer 5d2c510cf6 Pass the end of a component to SwiftAggLowering's enumerateComponents callback
This is usefull for determining whether components overlap.

llvm-svn: 283932
2016-10-11 20:34:03 +00:00
Rui Ueyama e05e9502c5 Fix a test to pacify llvm-clang-lld-x86_64-scei-ps4-windows10pro bot.
I don't really understand why we get a larger .rodata section only
on this bot. I guess it may be picking up a library which contains
a .rodata. I removed the specific values since their values are not
important for this test case.

llvm-svn: 283931
2016-10-11 20:15:36 +00:00
Sanjay Patel c2bd185dc4 [x86] add tests for negate bool
llvm-svn: 283930
2016-10-11 20:15:20 +00:00
Jim Ingham 2aa6ef7567 This test now passes.
llvm-svn: 283929
2016-10-11 20:09:40 +00:00
Reid Kleckner 5d0bc63d91 Avoid braced initialization for default member initializers for MSVC 2013
llvm-svn: 283928
2016-10-11 20:02:57 +00:00
Arnold Schwaighofer 9103e268cf Silence -Wunused-but-set-variable warning
llvm-svn: 283927
2016-10-11 19:49:29 +00:00
Rui Ueyama 9f66f8277d Re-submit r283825: Add section header stream to PDB.
It was reverted because the change that depends on was reverted.
Now it was submitted as r283925, so we can submit this as well.

llvm-svn: 283926
2016-10-11 19:45:07 +00:00
Rui Ueyama f9904043ca Re-submit r283823: Define DbiStreamBuilder::addDbgStream to add stream.
The previous commit was failing because we filled empty slots of
the debug stream index with kInvalidStreamIndex. It should've been 0.

llvm-svn: 283925
2016-10-11 19:43:12 +00:00
Kostya Serebryany 4d25ad93f3 [sanitizer-coverage] use private linkage for coverage guards, delete old commented-out code.
llvm-svn: 283924
2016-10-11 19:36:50 +00:00
Jim Ingham e8be3ad9b2 Added a bugreport tracking the failure to get float return values
on i386.

llvm-svn: 283923
2016-10-11 19:29:25 +00:00
Rui Ueyama 888de9b031 Fix build error on LP64 platforms.
llvm-svn: 283922
2016-10-11 19:28:56 +00:00
Zachary Turner 733be51dcd [raw_ostream] Raise some helper functions out of raw_ostream.
Low level functionality to format numbers were embedded in the
implementation of raw_ostream.  I have need to use these through
an interface other than the overloaded stream operators, so they
need to be raised to a level that they can be used from either
raw_ostream operators or other code.

llvm-svn: 283921
2016-10-11 19:24:45 +00:00
Mehdi Amini 7186a4323e Revert "Change Builtins name to be stored as StringRef instead of raw pointers (NFC)"
This reverts commit r283802. It introduces temporarily static
initializers, because StringRef ctor isn't (yet) constexpr for
string literals.
I plan to get there this week, but apparently GCC is so terrible
with these static initializer right now (10 min+ extra codegen
time was reported) that I'll hold on to this patch till the
constexpr one is ready, and land these at the same time.

llvm-svn: 283920
2016-10-11 19:04:24 +00:00
Konstantin Zhuravlyov cdd4547607 [AMDGPU] Refactor waitcnt encoding
- Refactor bit packing/unpacking
- Calculate bit mask given bit shift and bit width
- Introduce function for decoding bits of waitcnt
- Introduce function for encoding bits of waitcnt
- Introduce function for getting waitcnt mask (instead of using bare numbers)
- Introduce function fot getting max waitcnt(s) (instead of using bare numbers)

Differential Revision: https://reviews.llvm.org/D25298

llvm-svn: 283919
2016-10-11 18:58:22 +00:00
Dehao Chen e9d075233a Allow Switch instruction to have extractProfTotalWeight called as it can terminate a basic block. (NFC)
llvm-svn: 283918
2016-10-11 18:53:00 +00:00
Bruno Cardoso Lopes c9fb1ff192 [Driver] Use -fsyntax-only in test/Driver/show-option-names.c
Make the test less expensive, follow up from r283915.

llvm-svn: 283917
2016-10-11 18:38:33 +00:00
Reid Kleckner a012dac9d6 Avoid unnecessary constexpr to appease MSVC 2013
llvm-svn: 283916
2016-10-11 18:35:13 +00:00
Bruno Cardoso Lopes b81cf735c3 [Driver] Fix test from r283913 to unbreak bots
Followup from r283913 & r283827

http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55135

llvm-svn: 283915
2016-10-11 18:31:45 +00:00
Mehdi Amini caec5559cb Fix "static initialization order fiasco" for the XCore Target.
I fixed all the other Targets in r283702, and interestingly the
sanitizers are only now "sometimes" catching this bug on the only
one I missed.

llvm-svn: 283914
2016-10-11 18:22:41 +00:00
Bruno Cardoso Lopes 76952a76e5 Reapply [Driver][Diagnostics] Make 'show option names' default for driver warnings
Reapply r283827 by fixing the tests to not be target specific

Currently, driver level warnings do not show option names (e.g. warning:
complain about foo [-Woption-name]) in a diagnostic unless
-fdiagnostics-show-option is explictly specified. OTOH, the driver by
default turn this option on for CC1. Change the logic to show option
names by default in the driver as well.

Differential Revision: https://reviews.llvm.org/D24516

rdar://problem/27300909

llvm-svn: 283913
2016-10-11 18:21:26 +00:00
Zachary Turner 76e007e7e3 [Support] Fix undefined behavior in RandomNumberGenerator.
This has existed pretty much forever AFAICT, but the code was
never being exercised because nobody was using the class.  A
user of this class surfaced, and now we're breaking with UB.
The code was obviously wrong, so it's fixed here.

llvm-svn: 283912
2016-10-11 18:17:26 +00:00
Konstantin Zhuravlyov 78f3fa774b [AMDGPU] Fix test that was broken by rL283893
llvm-svn: 283911
2016-10-11 18:16:56 +00:00
Rui Ueyama 110dda7915 Make variable name consistent with other -z options.
llvm-svn: 283910
2016-10-11 17:46:48 +00:00
NAKAMURA Takumi e9587bd771 ARMMachineFunctionInfo.cpp: Add an initializer of ARMFunctionInfo::ReturnRegsCount in the explicit ctor.
It caused crash since r283867.

llvm-svn: 283909
2016-10-11 17:38:30 +00:00
NAKAMURA Takumi e61de02016 Reformat.
llvm-svn: 283908
2016-10-11 17:38:25 +00:00
Justin Lebar 49ec14692a [CUDA] Re-land support for <complex> (r283683 and r283680).
These were reverted in r283753 and r283747.

The first patch added a header to the root 'Headers' install directory,
instead of into 'Headers/cuda_wrappers'.  This was fixed in the second
patch, but by then the damage was done: The bad header stayed in the
'Headers' directory, continuing to break the build.

We reverted both patches in an attempt to fix things, but that still
didn't get rid of the header, so the Windows boostrap build remained
broken.

It's probably worth fixing up our cmake logic to remove things from the
install dirs, but in the meantime, re-land these patches, since we
believe they no longer have this bug.

llvm-svn: 283907
2016-10-11 17:36:03 +00:00
Reid Kleckner 25717350e5 Fix the build with MSVC 2013 after r283856
llvm-svn: 283906
2016-10-11 17:24:09 +00:00
Sanjay Patel 8253e15ef3 [DAG] add fold for masked negated sign-extended bool
This enhances the fold added with:
https://reviews.llvm.org/rL283900

llvm-svn: 283905
2016-10-11 17:05:52 +00:00
Sean Callanan 0354a6888f Clarified the explanation of expr --top-level.
llvm-svn: 283904
2016-10-11 16:57:21 +00:00
Sanjay Patel 58b4987284 [x86] add sext variants of tests added with r283894
llvm-svn: 283903
2016-10-11 16:49:52 +00:00
Bernard Ogden c5164132fe Let test pass for builds that support X86, but do not default to it
Differential Revision: https://reviews.llvm.org/D25471

llvm-svn: 283902
2016-10-11 16:34:49 +00:00
Bernard Ogden 2cf7ca3f35 Fix test on non-x86 hosts
Summary:
This test is allowed to run on non-x86 hosts and thus must use
llvm-nm rather than nm.

Differential Revision: https://reviews.llvm.org/D25473

llvm-svn: 283901
2016-10-11 16:32:37 +00:00
Sanjay Patel 8384703d9b [DAG] add fold for masked negated extended bool
The non-obvious motivation for adding this fold (which already happens in InstCombine)
is that we want to canonicalize IR towards select instructions and canonicalize DAG 
nodes towards boolean math. So we need to recreate some folds in the DAG to handle that
change in direction. 

An interesting implementation difference for cases like this is that InstCombine
generally works top-down while the DAG goes bottom-up. That means we need to detect 
different patterns. In this case, the SimplifyDemandedBits fold prevents us from 
performing a zext to sext fold that would then be recognized as a negation of a sext. 

llvm-svn: 283900
2016-10-11 16:26:36 +00:00
Daniel Jasper b617286089 Silence unused warning in non-assert builds.
llvm-svn: 283899
2016-10-11 16:22:36 +00:00
Adam Nemet 3996caa1a6 [opt-viewer] Remove unnecessary call to demangle
llvm-svn: 283898
2016-10-11 16:20:40 +00:00
Adam Nemet e437504b30 [opt-viewer] Print hotness as percentage of the maximum hotness
llvm-svn: 283897
2016-10-11 16:20:38 +00:00