Commit Graph

277905 Commits

Author SHA1 Message Date
Sanjay Patel b6404a8ca6 [InstCombine] canonicalize constant-minus-boolean to select-of-constants
This restores the half of:
https://reviews.llvm.org/rL75531
that was reverted at:
https://reviews.llvm.org/rL159230

For the x86 case mentioned there, we now produce:
leal 1(%rdi), %eax
subl %esi, %eax

We have target hooks to invert this in DAGCombiner (and x86 is enabled) with:
https://reviews.llvm.org/rL296977
https://reviews.llvm.org/rL311731

AArch64 and possibly other targets would probably benefit from enabling those hooks too. 
See PR30327:
https://bugs.llvm.org/show_bug.cgi?id=30327#c2

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

llvm-svn: 319964
2017-12-06 21:22:57 +00:00
Matthew Simpson e363d2cebb [PGO] Make indirect call promotion a utility
This patch factors out the main code transformation utilities in the pgo-driven
indirect call promotion pass and places them in Transforms/Utils. The change is
intended to be a non-functional change, letting non-pgo-driven passes share a
common implementation with the existing pgo-driven pass.

The common utilities are used to conditionally promote indirect call sites to
direct call sites. They perform the underlying transformation, and do not
consider profile information. The pgo-specific details (e.g., the computation
of branch weight metadata) have been left in the indirect call promotion pass.

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

llvm-svn: 319963
2017-12-06 21:22:54 +00:00
Dan Gohman 7ae3f46539 [WebAssembly] Commit a file I accidentally omitted from r319956.
llvm-svn: 319962
2017-12-06 21:16:04 +00:00
Jonathan Peyton ebbcb43976 [OpenMP] Add entry for Intel Compiler 18
Patch by Simon Convent

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

llvm-svn: 319961
2017-12-06 21:15:28 +00:00
Jonathan Peyton 125203e003 Eliminate double printing of verbose affinity settings
Redundant extra verbose output of binding to full mask in case
affinity=balanced or OMP_PLACES=<any> or OMP_PROC_BIND=<any>

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

llvm-svn: 319960
2017-12-06 21:07:41 +00:00
Shoaib Meenai f7c7944387 [libc++] Create install-stripped targets
LLVM is gaining install-*-stripped targets to perform stripped installs,
and in order for this to be useful for install-distribution, all
potential distribution components should have stripped installation
targets. LLVM has a function to create these install targets, but since
we can't use LLVM CMake functions in libc++, let's do it manually.

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

llvm-svn: 319959
2017-12-06 21:03:42 +00:00
Philip Pfaffe d98dbeeb71 Port SCEVAffinator to the isl c++ bindings
Summary: Straight forward port of SCEVAffinator

Reviewers: grosser, bollu, Meinersbur

Reviewed By: Meinersbur

Subscribers: pollydev, llvm-commits

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

llvm-svn: 319958
2017-12-06 21:02:22 +00:00
Jonathan Peyton ec5b87188d Trivial enum fix
This change is a trivial fix for enums that removes specification of "last" or
"upper" values, or other boundary values. This simplifies the code in places,
and results in never needing to update the "upper" values again.

Patch by Terry Wilmarth

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

llvm-svn: 319957
2017-12-06 21:02:15 +00:00
Dan Gohman ad19047d83 [WebAssembly] Remove WASM_STACK_POINTER.
WASM_STACK_POINTER and the .stack_pointer directive are no longer needed
now that the stack pointer global is an import.

llvm-svn: 319956
2017-12-06 20:56:40 +00:00
Ben Hamilton 4432231b13 [lld] Set up .arcconfig to point to new Diffusion LLD repository
Summary:
We want to automatically copy the appropriate mailing list
for review requests to the LLD repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"LLD" for lld:

https://reviews.llvm.org/source/lld/

This explicitly updates lld's .arcconfig to point to the new C
repository in Diffusion, which will let us use Herald rule H270.

Reviewers: peter.smith, ruiu, rafael, sammccall

Reviewed By: sammccall

Subscribers: dlj, bkramer, sammccall, klimek

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

llvm-svn: 319955
2017-12-06 20:56:23 +00:00
Ben Hamilton f20525bc87 [compiler-rt] Set up .arcconfig to point to new Diffusion CRT repository
Summary:
We want to automatically copy the appropriate mailing list
as well as #sanitizers for review requests to the compiler-rt repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"CRT" for compiler-rt:

https://reviews.llvm.org/source/compiler-rt/

This explicitly updates compiler-rt's .arcconfig to point to the new
CRT repository in Diffusion, which will let us use Herald rules H270
and H271.

Reviewers: krytarowski, joerg, dvyukov, vitalybuka, sammccall

Reviewed By: sammccall

Subscribers: dlj, bkramer, dberris, llvm-commits, sammccall, klimek, #sanitizers

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

llvm-svn: 319954
2017-12-06 20:55:32 +00:00
Shoaib Meenai 5e8d5ccfe7 [lldb] Use PRIVATE in target_link_libraries
This is a follow-up to r319840. I guess none of the systems I'd tested
on before had LLDB_SYSTEM_LIBS set, which is why I didn't see any local
errors, but I'm surprised none of the bots caught it either.

llvm-svn: 319953
2017-12-06 20:53:03 +00:00
Florian Hahn 001c3dd202 [MachineCombiner] Add up latencies of all instructions in new pattern.
Summary:
When calculating the RootLatency, we add up all the latencies of the
deleted instructions. But for NewRootLatency we only add the latency of
the new root instructions, ignoring the latencies of the other
instructions inserted. This leads the combiner to underestimate the cost
of patterns which add multiple instructions. This patch fixes that by
summing up the latencies of all new instructions. For NewRootNode, the
more complex getLatency function is used.

Note that we may be slightly more precise than just summing up
all latencies. For example, consider a pattern like

    r1 = INS1 ..
    r2 = INS2 ..
    r3 = INS3 r1, r2

I think in some other places, the total latency of the pattern would be
estimated as lat(INS3) + max(lat(INS1), lat(INS2)). If you consider
that worth changing, I think it would be best to do in a follow-up
patch.

Reviewers: Gerolf, sebpop, spop, fhahn

Reviewed By: fhahn

Subscribers: evandro, llvm-commits

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

llvm-svn: 319951
2017-12-06 20:27:33 +00:00
Shoaib Meenai 9e776fb0dc [clang] Use PRIVATE in target_link_libraries
I'd missed this one in r319840 because I hadn't been configuring with an
order file before.

llvm-svn: 319950
2017-12-06 20:05:42 +00:00
Alina Sbirlea 18fea013de [ModRefInfo] Do not use ModRefInfo result in if conditions as this makes
assumptions about the values in the enum. Replace with wrapper returning
bool [NFC].

llvm-svn: 319949
2017-12-06 19:56:37 +00:00
Matt Morehouse 5a5c1d1c69 [CMake] Use PRIVATE in target_link_libraries for fuzzers.
Several fuzzers were missed by r319840.

llvm-svn: 319948
2017-12-06 19:52:40 +00:00
Florian Hahn 115d99162c [InlineFunction] Only replace call if there are VarArgs to forward.
Summary:
There is no need to replace the original call instruction if no
 VarArgs need to be forwarded. 

Reviewers: davide, rnk, majnemer, efriedma

Reviewed By: efriedma

Subscribers: eraman, llvm-commits

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

llvm-svn: 319947
2017-12-06 19:47:24 +00:00
Sanjay Patel 3e069f5724 [LoopUtils] simplify createTargetReduction(); NFCI
llvm-svn: 319946
2017-12-06 19:37:00 +00:00
Simon Pilgrim 9afbe77a91 [X86][AVX512] Tag mask reg op instruction scheduler classes
llvm-svn: 319945
2017-12-06 19:36:00 +00:00
Tim Shen b684b1aa35 [Hexagon] Suppress more warnings on unused variables defined for asserts.
llvm-svn: 319944
2017-12-06 19:33:42 +00:00
Vedant Kumar 50048ac65e Fix the -Wunused-function warning properly (MachProcess.mm)
r319938 was not NFC, because it got the preprocessor guard wrong. Check
WITH_FBS and WITH_BKS before defining SplitEventData.

llvm-svn: 319943
2017-12-06 19:27:20 +00:00
Richard Smith 692f66ab62 Delete special-case "out-of-range" handling for bools, and just use the normal
codepath plus the new "minimum / maximum value of type" diagnostic to get the
same effect.

Move the warning for an in-range but tautological comparison of a constant (0
or 1) against a bool out of -Wtautological-constant-out-of-range-compare into
the more-appropriate -Wtautological-constant-compare.

llvm-svn: 319942
2017-12-06 19:23:19 +00:00
Alina Sbirlea 5beb1838bb [ModRefInfo] Use createModRefInfo wrapper to create a ModRefInfo from FunctionModRefBehavior.
llvm-svn: 319941
2017-12-06 19:23:03 +00:00
Tim Shen 7654ed03e3 [Hexagon] Suppress warnings on unused variables defind for asserts.
llvm-svn: 319940
2017-12-06 19:22:19 +00:00
Vedant Kumar 94d788fa78 Fix const-correctness in RegisterContext methods, NFC
A few methods in RegisterContext classes accept const objects which are
cast to a non-const thread_state_t. Drop const-ness more explicitly
where we mean to do so. This fixes a slew of warnings.

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

llvm-svn: 319939
2017-12-06 19:21:12 +00:00
Vedant Kumar eacb0929e8 Fix an -Wunused-function warning, NFC
llvm-svn: 319938
2017-12-06 19:21:11 +00:00
Vedant Kumar 07d956149b Fix misc -Wcast-qual warnings, NFC
llvm-svn: 319937
2017-12-06 19:21:11 +00:00
Vedant Kumar 606908aab5 Remove no-op function pointer null checks, NFC
Null-checking functions which aren't marked weak_import is a no-op
(the compiler rewrites the check to 'true'), regardless of whether a
library providing its definition is weak-linked. If the deployment
target is greater than the minimum requirement, the availability markup
on APIs does not lower to weak_import.

Remove no-op null checks to clean up the code and silence warnings.

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

llvm-svn: 319936
2017-12-06 19:21:10 +00:00
Vedant Kumar 8465c38b1e Use a static_cast instead of a C cast, NFC
Pointed out by Davide Italiano in post-commit review.

llvm-svn: 319935
2017-12-06 19:21:09 +00:00
Vedant Kumar a73324b0a9 [MappedHash] Fix alignment violations
This fixes a few alignment problems pointed out by UBSan, and is
otherwise NFC.

llvm-svn: 319934
2017-12-06 19:21:08 +00:00
Rui Ueyama efb5024e57 [COFF] Ignore semicolons in module definition identifiers
Patch by David Major.

The NSS project's .def files make heavy use of semicolons in a
frightening attempt at portability:
https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/capi/nsscapi.def

lld-link was treating the semicolon as part of the export name,
resulting in unresolved symbols. This patch includes ';' in the list of
characters to split on.

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

llvm-svn: 319933
2017-12-06 19:18:24 +00:00
Rafael Espindola b6e2ca4597 Convert a check to checkLazy.
This brings memory allocations when linking clang from 270.96MB to
267.80MB.

llvm-svn: 319932
2017-12-06 19:17:20 +00:00
Jonas Hahnfeld 273d261b8f Fix PR35542: Correct adjusting of private reduction variable
The adjustment is calculated with CreatePtrDiff() which returns
the difference in (base) elements. This is passed to CreateGEP()
so make sure that the GEP base has the correct pointer type:
It needs to be a pointer to the base type, not a pointer to a
constant sized array.

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

llvm-svn: 319931
2017-12-06 19:15:28 +00:00
Rafael Espindola 0ab9d8b6ed Add an early return.
Total memory allocation when linking clang goes from 281.80MB to
270.96MB.

llvm-svn: 319930
2017-12-06 19:13:23 +00:00
Alex Shlyapnikov e85b4df435 [TSan] Make more TSan interceptors symbolizer-aware.
Summary:
Switching the rest of intercepted allocs to InternalAlloc (well, except
__libc_memalign) when current thread is 'in_symbolizer'. Symbolizer
might (and does) use allocation functions other than malloc/calloc/realloc.

posix_memalign is the one actually used, others switched just in case
(since the failure is obscure and not obvious to diagnose).

Reviewers: dvyukov

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 319929
2017-12-06 19:12:57 +00:00
Sanjay Patel 1ea7b6f7a1 [LoopUtils] fix variable name to match FMF vocabulary; NFC
llvm-svn: 319928
2017-12-06 19:11:23 +00:00
Rafael Espindola aca3df5479 Convert a few uses of check to checkLazy.
Linking clang goes from 292.68MB to 281.80MB allocated.

llvm-svn: 319927
2017-12-06 19:08:10 +00:00
Rafael Espindola 5b491a29fb Convert a call to check to checkLazy.
Linking clang goes from 300.82MB to 292.68MB allocated.

llvm-svn: 319926
2017-12-06 19:02:12 +00:00
Zachary Turner c221dc71b1 Update obj2yaml and yaml2obj for .debug$H section.
Differential Revision: https://reviews.llvm.org/D40842

llvm-svn: 319925
2017-12-06 18:58:48 +00:00
Rafael Espindola c8dfde2051 Replace one use of check with checkLazy.
Reduce total allocation when linking clang from 320.04MB to 300.82MB.

llvm-svn: 319924
2017-12-06 18:56:22 +00:00
Davide Italiano 9c60c7dcf4 [Target] dumpr() is defined only in debug builds.
This fixes the clang build on macOS.

llvm-svn: 319923
2017-12-06 18:54:17 +00:00
Rafael Espindola 9ffa988b5d Add a checkLazy error checking variant.
This avoids allocating the error message when there is no error that
check requires.

It avoids the code duplication of inlining check.

llvm-svn: 319922
2017-12-06 18:52:13 +00:00
Simon Pilgrim 7724b03cde [X86][SSE] Regenerate vpmovm2*/vpmov*2m avx512 schedule tests
llvm-svn: 319921
2017-12-06 18:47:37 +00:00
Simon Pilgrim d255a6201d [X86][AVX512] Tag scalar insert/extract instruction scheduler classes
Classes don't look great but match what we're doing on SSE/AVX

llvm-svn: 319920
2017-12-06 18:46:06 +00:00
Craig Topper 8b0f185c31 [X86] Simplify the TTI code for getInterleavedMemoryOpCost around for AVX512BW. NFCI
Previously the lambda for AVX512 passed out a flag that indicated whether AVX512BW was required and that was checked against the AVX512BW subtarget flag outside.

This patch changes the interface to pass the AVX512BW subtarget bit in and return its value if we detect 16 or 8 bit types.

llvm-svn: 319919
2017-12-06 18:40:46 +00:00
Rafael Espindola 8b97611190 Don't allocate memory for an error message on success.
This takes memory allocations when linking clang-fsds from 342.08MB to
320.04MB.

llvm-svn: 319918
2017-12-06 18:39:22 +00:00
Shoaib Meenai 6aa13adf0e [cmake] Remove unnecessary header include in atomics check
The header include was required to work around PR19898, as noted in that
comment. That PR has since been marked resolved fixed, and the
configuration check passes without the header inclusion both when
compiling on Windows with cl and when cross-compiling on Linux using
clang-cl.

I noticed this because the inclusion was cased incorrectly (Intrin.h
instead of intrin.h), which when cross-compiling on a case sensitive
file system would cause the intrin.h from the Windows SDK to be included
(which LLVM can't handle) instead of the one from clang's resource
directory, making the check fail. This is the same issue as r309980.
Correcting the case of the inclusion makes the check pass when cross
compiling, but it seems better to get rid of the inclusion entirely,
since it appears to be unnecessary now.

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

llvm-svn: 319917
2017-12-06 18:33:07 +00:00
Rafael Espindola f4c3239824 Don't allocate an error message when there is no error.
According to heaptrack this takes "bytes allocated in total" when
linking clang-fsds from 405.69MB to 342.08MB.

llvm-svn: 319916
2017-12-06 18:31:11 +00:00
Simon Pilgrim 809c024b3d [X86][AVX2] Tag MASKMOV instruction scheduler classes
llvm-svn: 319915
2017-12-06 18:24:48 +00:00
Craig Topper fa172a5251 [X86] Regenerate test for r319778
llvm-svn: 319914
2017-12-06 18:04:39 +00:00