Commit Graph

233071 Commits

Author SHA1 Message Date
Alina Sbirlea 76c4a855bc [cpu-detection] Substantial refactor of Host CPU detection code (x86)
Summary:
Following D20970 (committed as r271726).
This is a substantial refactoring of the host CPU detection code.

There is no functionality change intended, but the changes are extensive.

Definitions of architecture types and subtypes are by no means exhaustive or
perfectly defined, but a fair starting point.
Suggestions for futher improvements are welcome.

Reviewers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20988

llvm-svn: 271921
2016-06-06 18:29:59 +00:00
Devin Coughlin 917a42d8b5 Revert "Reapply "[analyzer] Add checker for correct usage of MPI API in C and C++.""
This reverts commit r271914. It is still breaking bots.

llvm-svn: 271920
2016-06-06 18:29:43 +00:00
Marshall Clow 217cf69b92 Rename some test data (and make it const) to rid us of some shadowing warnings in the test suite. No functional change. Thanks to STL@microsoft for the report and patch.
llvm-svn: 271919
2016-06-06 18:24:08 +00:00
Rafael Espindola 811e1ee03e Add a release note about the --build-id change.
llvm-svn: 271918
2016-06-06 18:23:11 +00:00
Lang Hames d29ee53628 [Kaleidoscope][BuildingAJIT] More cleanup of Chapter 2.
Streamline some wording, fix a bug in the markup for the layer interface table.

llvm-svn: 271917
2016-06-06 18:22:47 +00:00
Kuba Brecka 304b2c2a45 [tsan] Switch to InternalAlloc everywhere __libc_malloc is currently used
This patch replaces all uses of __libc_malloc and friends with the internal allocator.

It seems that the only reason why we have calls to __libc_malloc in the first place was the lack of the internal allocator at the time. Using the internal allocator will also make sure that the system allocator is never used (this is the same behavior as ASan), and we don’t have to worry about working with unknown pointers coming from the system allocator.

Differential Revision: http://reviews.llvm.org/D21025

llvm-svn: 271916
2016-06-06 18:18:47 +00:00
Etienne Bergeron 7a1bafd6ae This patch attempts to primitive support for Win64 asan
Some known issues are:

When "head" include instructions that involve branching, the "cut and paste" approach may break down in a way that function interception still work but calling back the original function does not work.
The jmp [rip -8] saves some bytes in the "head" but finding the safe zone of 0xCC is not implemented yet. So it may stomp on preceding codes.
The shadow offset is not working yet on Win64. More complexity maybe involved since there are some differences regarding virtual address space between Window 8 and Windows 8.1/10.

Patch by: Wang Wei

Differential Revision: http://reviews.llvm.org/D20884

llvm-svn: 271915
2016-06-06 18:09:54 +00:00
Devin Coughlin 8027409be4 Reapply "[analyzer] Add checker for correct usage of MPI API in C and C++."
Reapply r271907 with a fix for the compiler error with gcc about specializing
clang::ento::ProgramStateTrait in a different namespace.

Differential Revision: http://reviews.llvm.org/D12761

llvm-svn: 271914
2016-06-06 18:08:35 +00:00
Lang Hames 706db2e609 [Kaleidoscope][BuildingAJIT] Clean up sentence, remove comments from code block.
llvm-svn: 271913
2016-06-06 18:07:23 +00:00
Mike Spertus 3d1ab08e8a Fix typo in last submission to visualize proper template argument
llvm-svn: 271911
2016-06-06 17:23:37 +00:00
Mike Spertus 603bbfca10 Better Visual Studio visualization of TemplateArgument and TemplateArgumentList
For pack TemplateArguments, visualize all of the items in the pack
Visualize a TemplateArgumentList as a template argument list. E.g., <int, double>

llvm-svn: 271910
2016-06-06 17:08:32 +00:00
Devin Coughlin cc73e62ebe Revert "[analyzer] Add checker for correct usage of MPI API in C and C++."
This reverts commit r271907. It broke a bunch of bots with compile errors
about specializations in different namespaces.

llvm-svn: 271909
2016-06-06 17:01:08 +00:00
Sanjay Patel 6a333c3ed9 [InstCombine] limit icmp transform to ConstantInt (PR28011)
In r271810 ( http://reviews.llvm.org/rL271810 ), I loosened the check
above this to work for any Constant rather than ConstantInt. AFAICT, 
that part makes sense if we can determine that the shrunken/extended 
constant remained equal. But it doesn't make sense for this later 
transform where we assume that the constant DID change. 

This could assert for a ConstantExpr:
https://llvm.org/bugs/show_bug.cgi?id=28011

And it could be wrong for a vector as shown in the added regression test.

llvm-svn: 271908
2016-06-06 16:56:57 +00:00
Devin Coughlin 83ccd1a994 [analyzer] Add checker for correct usage of MPI API in C and C++.
This commit adds a static analysis checker to check for the correct usage of the
MPI API in C and C++.

3 path-sensitive checks are included:

- Double nonblocking: Double request usage by nonblocking calls
  without intermediate wait.
- Missing wait: Nonblocking call without matching wait.
- Unmatched wait: Waiting for a request that was never used by a
  nonblocking call.

Examples of how to use the checker can be found
at https://github.com/0ax1/MPI-Checker

Reviewers: zaks.anna

A patch by Alexander Droste!

Differential Revision: http://reviews.llvm.org/D12761

llvm-svn: 271907
2016-06-06 16:47:16 +00:00
Kuba Brecka cdf3492191 [tsan] On OS X, optimize main thread’s ThreadState accesses
This is a very simple optimization that gets about 10% speedup for certain programs. We’re currently storing the pointer to the main thread’s ThreadState, but we can store the state directly in a static variable, which avoid the load acquire.

Differential Revision: http://reviews.llvm.org/D20910

llvm-svn: 271906
2016-06-06 16:27:38 +00:00
Kuba Brecka 2e26d9faac [asan] Reenable ASan tests in "check-all"
Somehow, in r271049, ASan lit tests and unit tests were removed from “check-all”. Doesn’t seem intentional, let’s fix it.

Differential Revision: http://reviews.llvm.org/D21017

llvm-svn: 271905
2016-06-06 16:24:47 +00:00
Sanjay Patel 027c469158 regenerate checks
llvm-svn: 271904
2016-06-06 16:03:06 +00:00
Sanjay Patel 70aa568c4e regenerate checks
llvm-svn: 271903
2016-06-06 15:55:00 +00:00
Vedant Kumar 62baa4c752 [docs] Clarify limitations section of SourceBasedCodeCoverage.rst
Mention that the code coverage tool becomes less precise whenever
unpredictable changes in control flow occur.

Thanks to Sean Silva for pointing this out!

llvm-svn: 271902
2016-06-06 15:44:40 +00:00
Rui Ueyama 4ffda7a9cf Create version.txt in a reproduce archive file.
Differential Revision: http://reviews.llvm.org/D21008

llvm-svn: 271901
2016-06-06 15:34:37 +00:00
Artem Tamazov 135487767b [AMDGPU][llvm-mc] v_cndmask_b32: src2 is mandatory; do not enforce VOP2 when src2 == VCC.
Another step for unification llvm assembler/disassembler with sp3.
Besides, CodeGen output is a bit improved, thus changes in CodeGen tests.
Assembler/Disassembler tests updated/added.

Differential Revision: http://reviews.llvm.org/D20796

llvm-svn: 271900
2016-06-06 15:23:43 +00:00
Francis Ricci 80dbd154fa Don't remove PIE executables when using svr4 packets
Summary:
Because PIE executables have an e_type of llvm::ELF::ET_DYN,
they are not of type eTypeExecutable, and were being removed
when svr4 packets were used.

Reviewers: clayborg, ADodds, tfiala, sas

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20990

llvm-svn: 271899
2016-06-06 15:00:50 +00:00
Johannes Doerfert 8448071d3e Refactor division generation code
This patch refactors the code generation for divisions. This allows to
  always generate a shift for a power-of-two division and to utilize
  information about constant divisors in order to truncate the result
  type.

llvm-svn: 271898
2016-06-06 14:56:17 +00:00
Marshall Clow 3a407a096c Remove arithmetic +/-127 on chars; results in UB when dealing with signed chars. Thanks to STL@microsoft for the report.
llvm-svn: 271897
2016-06-06 14:35:22 +00:00
Samuel Benzaquen 79c76101ce [clang-tidy] Do not try to suggest a fix if the parameter is partially in a macro.
It is not easy to tell where to do the suggestion and whether the
suggestion will be correct.

llvm-svn: 271896
2016-06-06 14:21:11 +00:00
Matthew Simpson e3e3b994ae [LAA] Use load and store vectors (NFC)
Contributed-by: Aditya Kumar <hiraditya@msn.com>
Differential Revision: http://reviews.llvm.org/D20953

llvm-svn: 271895
2016-06-06 14:15:41 +00:00
Johannes Doerfert c0ece9b67e [NFC] Generate runtime checks after the SCoP
We now generate runtime checks __after__ the SCoP code generation and
  not before, though they are still inserted at the same position int
  the code. This allows to modify the runtime check during SCoP code
  generation.

llvm-svn: 271894
2016-06-06 13:32:52 +00:00
Joerg Sonnenberger e27aec9f4a Give FileCheck a hint on which ld to match. Under Windows, the preferred
match was the ld.elf_so that should be matched in a second step. Add one
of the ever-present-but-irrelevant-for-this-test arguments to the
pattern to force matching the right argument.

llvm-svn: 271893
2016-06-06 13:13:12 +00:00
Johannes Doerfert 4db8d80730 [FIX] Determine insertion point during SCEV expansion
llvm-svn: 271892
2016-06-06 13:05:21 +00:00
Igor Breger edafb0595e [KNL] Fix UMULO lowering.
Differential Revision: http://reviews.llvm.org/D21013

llvm-svn: 271891
2016-06-06 12:24:52 +00:00
Johannes Doerfert 1a6b0f7f07 [NFC] Refactor assumption tracking interface
llvm-svn: 271890
2016-06-06 12:16:10 +00:00
Johannes Doerfert 6a6a671c72 [NFC] Simplify code
llvm-svn: 271889
2016-06-06 12:13:24 +00:00
Johannes Doerfert dedb7693ec Look through IntToPtr & PtrToInt instructions
IntToPtr and PtrToInt instructions are basically no-ops that we can handle as
  such. In order to generate them properly as parameters we had to improve the
  ScopExpander, though the change is the first in the direction of a more
  aggressive scalar synthetization.

llvm-svn: 271888
2016-06-06 12:12:27 +00:00
Benjamin Kramer f21beb2c74 Remove dead function with incredibly broken assert.
Found by clang-tidy's misc-assert-side-effect.

llvm-svn: 271887
2016-06-06 12:10:42 +00:00
Johannes Doerfert b71900b89c [NFC] Simplify code
llvm-svn: 271886
2016-06-06 12:09:30 +00:00
Johannes Doerfert 4b2fd892ec [FIX] Do not recognize division by 0 as affine
llvm-svn: 271885
2016-06-06 12:08:34 +00:00
Daniel Sanders 0ca86fe84d [mips] The default ABI depends on the CPU not the Arch on MTI and IMG vendor triples.
Summary:
32-bit CPU's default to O32. 64-bit CPU's default to N64. The default CPU
(mips32r2/mips64r2) still depends on the arch so there's no functional
change when the CPU isn't specified but commands like:
  clang -target mips-mti-linux-gnu -mips64r2
will now default to a 64-bit ABI like our gcc toolchains do* instead of
asserting in the backend**.

Other vendors (including Triple::UnknownVendor) still derive the default
ABI from the arch.

* Although not the same one as our gcc toolchains, clang has historically
  defaulted to N64 where gcc defaults to N32.
** Mixing O32 and a 64-bit CPU causing assertions is a long-standing bug.

Reviewers: atanasyan

Subscribers: sdardis, cfe-commits

Differential Revision: http://reviews.llvm.org/D21016

llvm-svn: 271884
2016-06-06 12:02:21 +00:00
Eric Liu 3528832930 [clang-format] make header guard identification stricter (with Lexer).
Summary: make header guard identification stricter with Lexer.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D20959

llvm-svn: 271883
2016-06-06 11:00:13 +00:00
Filipe Cabecinhas 6e7d5467c0 [NFC] Silence gcc warning (-Wsign-compare)
llvm-svn: 271882
2016-06-06 10:49:56 +00:00
Johannes Doerfert f643785b14 Replace getSCEV with getSCEVAtScope
llvm-svn: 271881
2016-06-06 10:07:40 +00:00
Johannes Doerfert ba91a58e42 [NFC] Use the ScalarEvolution member of the SCEVAffinator
llvm-svn: 271880
2016-06-06 10:06:53 +00:00
Johannes Doerfert 48975276be [NFC] Coalesce invariant context sets early
llvm-svn: 271879
2016-06-06 10:06:07 +00:00
Johannes Doerfert 0767a511ba Use minimal types for generated expressions
We now use the minimal necessary bit width for the generated code. If
  operations might overflow (add/sub/mul) we will try to adjust the types in
  order to ensure a non-wrapping computation. If the type adjustment is not
  possible, thus the necessary type is bigger than the type value of
  --polly-max-expr-bit-width, we will use assumptions to verify the computation
  will not wrap. However, for run-time checks we cannot build assumptions but
  instead utilize overflow tracking intrinsics.

llvm-svn: 271878
2016-06-06 09:57:41 +00:00
Daniel Sanders 28d8637e25 [mips] The P5600 does not support N32/N64 since it's a 32-bit CPU.
Summary:

Reviewers: atanasyan

Subscribers: cfe-commits, sdardis

Differential Revision: http://reviews.llvm.org/D20963

llvm-svn: 271877
2016-06-06 09:47:32 +00:00
Carlo Kok 490d18b3c5 (Minor tweak) Make RegisterContextWindows_x86/x64::GetRegisterInfoAtIndex
return NULL for an invalid register.

The unwind logic asks for the "return address register" which doesn't exist
on x86/x86_64, returns -1 and calls this with -1 as a parameter, ends up 
out of scope of the array bounds for g_register_infos and later SIGSEGVs 
on accessing. This now matches the other GetRegisterInfoAtIndex for
other platforms.

llvm-svn: 271876
2016-06-06 09:40:27 +00:00
Daniel Sanders 26a56adaea [mips] Replace almost all Arch checks in MipsTargetInfo with ABI checks. NFC.
Summary:
setABI() is still tied to the Arch component of the Triple to preserve existing
behaviour.

Reviewers: atanasyan

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D20961

llvm-svn: 271875
2016-06-06 09:07:08 +00:00
George Rimar 8b3c5f2b30 [ELF] - Assign sh_link field of SHT_GNU_versym section to DynSymTab section index.
.gnu.version should have sh_link field initialized with index of DynSymTab section.

GNU documentation looks misses that, but Sun docs mention it, according to
https://docs.oracle.com/cd/E19120-01/open.solaris/819-0690/chapter6-54676/index.html 
versym sh_link is indeed supposed to point to the .dynsym section.

Binutils readelf tool also relies on that:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/readelf.c;h=b6454d353279dc57745cd5a2d68b5f3f69f8e17c;hb=5522f910cb539905d6adfdceab208ddfa5e84557#l9988

Both gold/bfd do the same + after this patch I am able to see this section in readelf output, was unable before in my case.

Differential revision: http://reviews.llvm.org/D20956

llvm-svn: 271874
2016-06-06 08:04:53 +00:00
Craig Topper f51cc07719 [AVX512] Convert masked palignr builtins directly to native IR similar to the other palignr builtins, but with a select to handle masking.
llvm-svn: 271873
2016-06-06 06:13:01 +00:00
Craig Topper 33350cc406 [AVX512] Remove masked palignr intrinsics and auto-upgrade them to native IR of vector shuffle and select.
llvm-svn: 271872
2016-06-06 06:12:54 +00:00
NAKAMURA Takumi 500b0a49d2 LLVM_BUILD_32_BITS: Add -m32 with CMAKE_C*_FLAGS. [CMP0056]
With CMP0056, try_compile() uses also CMAKE_EXE_LINKER_FLAG.
It caused mismatch between CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS, to fail to examine CXX_SUPPORTS_CXX11 with -m32.

FYI, before this, try_compile() tries without -m32 regardless of LLVM_BUILD_32_BITS.

llvm-svn: 271871
2016-06-06 05:54:55 +00:00