Commit Graph

195758 Commits

Author SHA1 Message Date
Saleem Abdulrasool af7e539595 Unwind: tweak register handling for AArch64
AArch64 uses // as the comment character (although, Darwin uses ;).  However,
since we are using the C preprocessor on these files, // can be used as the
comment character across the board.

Tweak the platform guard to recognise __aarch64__ as well as __arm64__ for the
platform identifier.

llvm-svn: 231578
2015-03-07 21:36:08 +00:00
Benjamin Kramer f027ad7883 Make the assertion macros in Verifier and Linter truly variadic.
NFC.

llvm-svn: 231577
2015-03-07 21:15:40 +00:00
David Majnemer b654b55619 Fix unused variable/function warnings
llvm-svn: 231576
2015-03-07 20:56:50 +00:00
Benjamin Kramer 57dd9bd5cc ASTMatchers: Make AST_POLYMORPHIC_SUPPORTED_TYPES a variadic macro
C++11 finally allows us to use this C99 feature.

llvm-svn: 231575
2015-03-07 20:38:15 +00:00
David Majnemer 1a666e0f69 ExecutionEngine: Preliminary support for dynamically loadable coff objects
Provide basic support for dynamically loadable coff objects. Only handles a subset of x64 currently.

Patch by Andy Ayers!

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

llvm-svn: 231574
2015-03-07 20:21:27 +00:00
Nico Weber 3b00fdce07 Wrap to 80 columns. No behavior change.
llvm-svn: 231573
2015-03-07 19:52:39 +00:00
Benjamin Kramer 867bfc53ee Make constant arrays that are passed to functions as const.
In theory this allows the compiler to skip materializing the array on
the stack. In practice clang often fails to do that, but that's a
different story. NFC.

llvm-svn: 231571
2015-03-07 17:41:00 +00:00
Rui Ueyama c6bf34418a Remove duplicate code. NFC.
llvm-svn: 231570
2015-03-07 16:49:14 +00:00
Simon Pilgrim 2dcbe74dfd Use SDValue bool check to tidyup some possible combines. NFC.
llvm-svn: 231569
2015-03-07 16:34:55 +00:00
Rui Ueyama 51ae7e8622 Remove redundant empty destructors.
Both File and Atom have virtual destructors. We don't need to repeat
that in derived classes.

llvm-svn: 231568
2015-03-07 16:01:13 +00:00
Aaron Ballman 6b329f5cd2 Adding parenthesis around logical expressions to silence a -Wparentheses warning; NFC.
llvm-svn: 231567
2015-03-07 15:16:27 +00:00
Aaron Ballman 5287f0c3c7 Removing spurious semi-colons; NFC
llvm-svn: 231566
2015-03-07 15:10:32 +00:00
Benjamin Kramer 4e0c7928e2 X86: Roll repetitive code into a loop. NFC.
llvm-svn: 231565
2015-03-07 15:06:16 +00:00
Benjamin Kramer f8b86964ca Reapply r231508 "CodeGen: Emit constant temporaries into read-only globals."
I disabled putting the new global into the same COMDAT as the function for now.
There's a fundamental problem when we inline references to the global but still
have the global in a COMDAT linked to the inlined function. Since this is only
an optimization there may be other versions of the COMDAT around that are
missing the new global and hell breaks loose at link time.

I hope the chromium build doesn't break this time :)

llvm-svn: 231564
2015-03-07 13:37:13 +00:00
Andrea Di Biagio c9d79e8103 [DAGCombiner] Fix wrong folding of AND dag nodes.
This patch fixes the logic in the DAGCombiner that folds an AND node according
to rule: (and (X (load V)), C) -> (X (load V))

An AND between a vector load 'X' and a constant build_vector 'C' can be folded
into the load itself only if we can prove that the AND operation is redundant.
The algorithm implemented by 'visitAND' firstly computes the splat value 'S'
from C, and then checks if S has the lower 'B' bits set (where B is the size in
bits of the vector element type). The algorithm takes into account also the
'undef' bits in the splat mask.

Unfortunately, the algorithm only worked under the assumption that the size of S
is a multiple of the vector element type. With this patch, we conservatively
avoid folding the AND if the splat bits are not compatible with the vector
element type.

Added X86 test and-load-fold.ll

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

llvm-svn: 231563
2015-03-07 12:24:55 +00:00
Kuba Brecka 133b615558 Adding sanitizer_symbolizer_win.h to CMakeLists.txt
llvm-svn: 231562
2015-03-07 11:04:36 +00:00
Chandler Carruth 324f75aa47 [Modules] Include the header needed for make_unique, otherwise we can't
build this header in a module.

llvm-svn: 231561
2015-03-07 10:55:47 +00:00
Chandler Carruth dc57c481af Teach the LLVM CMake build how to explicitly use libc++abi when using
libc++. This lets me almost self-host on Linux with libc++ and libc++abi
very simply.

Currently, MCJIT and OrcJIT are failing due to uncaught exceptions, and
the Go binding tests are failing to build due to not linking in the
correct C++ standard library.

llvm-svn: 231560
2015-03-07 10:30:34 +00:00
Chandler Carruth 7e7dd47fc2 Much like we silence warnings about -flto in many cases to facilitate
simplicity in build systems, silence '-stdlib=libc++' when linking. Even
if we're not linking C++ code per-se, we may be passing this flag so
that when we are linking C++ code we pick up the desired standard
library. While most build systems already provide separate C and C++
compile flags, many conflate link flags. Sadly, CMake is among them
causing this warning in a libc++ selfhost.

llvm-svn: 231559
2015-03-07 10:01:29 +00:00
Chandler Carruth df397c520d [PM] Fixup for r231556 where I missed a dependency on intrinsics
generation.

llvm-svn: 231558
2015-03-07 09:08:20 +00:00
Chandler Carruth 9244582b8d Update makefile to reflect that the Passes directory is gone here.
llvm-svn: 231557
2015-03-07 09:03:17 +00:00
Chandler Carruth 1ff7724da5 [PM] Create a separate library for high-level pass management code.
This will provide the analogous replacements for the PassManagerBuilder
and other code long term. This code is extracted from the opt tool
currently, and I plan to extend it as I build up support for using the
new pass manager in Clang and other places.

Mailing this out for review in part to let folks comment on the terrible names
here. A brief word about why I chose the names I did.

The library is called "Passes" to try and make it clear that it is a high-level
utility and where *all* of the passes come together and are registered in
a common library. I didn't want it to be *limited* to a registry though, the
registry is just one component.

The class is a "PassBuilder" but this name I'm less happy with. It doesn't
build passes in any traditional sense and isn't a Builder-style API at all. The
class is a PassRegisterer or PassAdder, but neither of those really make a lot
of sense. This class is responsible for constructing passes for registry in an
analysis manager or for population of a pass pipeline. If anyone has a better
name, I would love to hear it. The other candidate I looked at was
PassRegistrar, but that doesn't really fit either. There is no register of all
the passes in use, and so I think continuing the "registry" analog outside of
the registry of pass *names* and *types* is a mistake. The objects themselves
are just objects with the new pass manager.

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

llvm-svn: 231556
2015-03-07 09:02:36 +00:00
Simon Pilgrim bede80a440 [DAGCombiner] SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(V,C)) -> VECTOR_SHUFFLE
This patch attempts to convert a SCALAR_TO_VECTOR using an operand from an EXTRACT_VECTOR_ELT into a VECTOR_SHUFFLE.

This prevents many cases of spilling scalar data between the gpr + simd registers. 

At present the optimization only accepts cases where there is no TRUNC of the scalar type (i.e. all types must match).

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

llvm-svn: 231554
2015-03-07 05:52:42 +00:00
Jordan Rose 58f8cc15c9 [analyzer] RetainCountChecker: CF properties are always manually retain-counted.
In theory we could assume a CF property is stored at +0 if there's not a custom
setter, but that's not really worth the complexity. What we do know is that a
CF property can't have ownership attributes, and so we shouldn't assume anything
about the ownership of the ivar.

rdar://problem/20076963

llvm-svn: 231553
2015-03-07 05:47:24 +00:00
Rui Ueyama 9b21ded6c8 Resolver: optimize fallback atoms.
Atoms with fallback atoms are never be added to the symbol table.
However, we added such atoms to _undefines array. We had to call
isCoalescedAway to identify and skip them. We should just stop
adding them in the first place.

This seems to make the linker ~1% faster in my test case.

llvm-svn: 231552
2015-03-07 04:23:46 +00:00
Rui Ueyama abd39f0549 Resolver: Reduce number of SymbolTable::isDefined function calls.
If an undefined symbol is added to the symbol table by the previous
call of SymbolTable::add, SymbolTable::isDefined will always return
false for the same symbol.

llvm-svn: 231551
2015-03-07 03:55:32 +00:00
Vince Harron b3237de6e4 Move Python Init from InitializeForLLGS to Initialize
Linux configure+make builds have ~175 tests failing that aren't
failing in cmake builds.  The tests have error messages like
"'a.out' doesn't contain the architecture x86-64"  ObjectFileELF
plugin wasn't loaded when this message was output.
    
I found ScriptInterpreterPython::InitializePrivate() is calling
Debugger::Terminate(), which terminates ObjectFileELF (and lots
of other stuff) setup earlier in the InitializeForLLGS.
    
So I moved python Init/Term from Init/TermForLLGS to Init/Term

llvm-svn: 231550
2015-03-07 03:37:15 +00:00
Rui Ueyama 923147b954 Resolver: Reduce number of hash function call.
This is yet another optimization patch. Previously we called
SymbolTable::isDefined() and SymbolTable::findByName() from a very
frequently executed function. Because isDefined calls findByName,
findByName is called twice on each iteration.

findByName is not a cheap function. It computes a hash value for a
given symbol name. When linking C++ programs, it can be expensive
because of C++ mangled long symbols.

This patch reduces the number of call from 2 to 1. Performance
improvements by this patch was larger than I expected. Linking time
of chrome.dll gets almost 5% shorter.

llvm-svn: 231549
2015-03-07 03:22:37 +00:00
Anton Yartsev 80fce4e7da [analyzer] Remove unused type (addition to r231540: "Revert changes from r229593")
llvm-svn: 231548
2015-03-07 01:57:31 +00:00
Eric Christopher 25dbdeb4d1 Typo.
llvm-svn: 231547
2015-03-07 01:39:09 +00:00
Eric Christopher e035e26655 Remove use of misched-bench from this test and replace it with
non-temporary enabling options. This is part of removing misched-bench
as an option.

llvm-svn: 231546
2015-03-07 01:39:06 +00:00
Rui Ueyama e9d646d448 PECOFF: Do not add extraneous symbols to the dead strip root.
Previously we added all undefined symbols found in object files to
the dead strip root. This patch makes the linker to stop doing that.
Undefined symbols would be resolved anyway, so this patch doesn't
change the linker behavior. It should slightly improve performance
but it's really marginal. This is a cleanup.

llvm-svn: 231545
2015-03-07 01:35:50 +00:00
Frederic Riss 23e20e95e9 [dsymutil] Apply relocations to DIE data before cloning.
Doing this gets function's low_pc and global variable's locations right
in the output debug info. It also could get right other attributes
that need to be relocated (in linker terms), but I don't know of any
other than the address attributes.

This doesn't fixup low_pc attributes in compile_unit, lexical_block
or inlined subroutine, nor does it get right high_pc attributes
for function. This will come in a subsequent commit.

llvm-svn: 231544
2015-03-07 01:25:09 +00:00
Rui Ueyama d4dc7d5739 Remove unused typedefs.
llvm-svn: 231543
2015-03-07 01:04:40 +00:00
Rui Ueyama 48c134ecd9 Use multimap<T, U> instead of map<T, set<U>>. NFC.
llvm-svn: 231542
2015-03-07 01:00:44 +00:00
Hans Wennborg cd8f011157 Revert r231508 "CodeGen: Emit constant temporaries into read-only globals."
This broke the Chromium build. Links were failing with messages like:

obj/dbus/libdbus_test_support.a(obj/dbus/dbus_test_support.mock_object_proxy.o):../../dbus/mock_object_proxy.cc:function dbus::MockObjectProxy::Detach(): warning: relocation refers to discarded section
/usr/local/google/work/chromium/src/third_party/binutils/Linux_x64/Release/bin/ld.gold: error: treating warnings as errors

llvm-svn: 231541
2015-03-07 00:46:19 +00:00
Anton Yartsev 4eb394d6c1 [analyzer] Revert changes from r229593; an enhancement is under discussion
llvm-svn: 231540
2015-03-07 00:31:53 +00:00
Eric Christopher 7e70aba1a8 Recommit r231324 with a fix to the ARM execution domain code
to disable lane switching if we don't actually have the instruction
set we want to switch to. Models the earlier check above the
conditional for the pass.

The testcase is one that triggered with the assert that's added
as part of the fix, use it to avoid adding a new testcase as it
highlights the same problem.

llvm-svn: 231539
2015-03-07 00:12:22 +00:00
Richard Smith f19e12794d Replace Sema's map of locally-scoped extern "C" declarations with a DeclContext
of extern "C" declarations. This is simpler and vastly more efficient for
modules builds (we no longer need to load *all* extern "C" declarations to
determine if we have a redeclaration).

No functionality change intended.

llvm-svn: 231538
2015-03-07 00:04:49 +00:00
Greg Clayton 910db5c520 Help for _regexp-break wasn't very clear. Added more detailed explanations of all things that can be typed by the _regexp-break command.
<rdar://problem/12281058>

llvm-svn: 231537
2015-03-07 00:01:46 +00:00
David Majnemer b6207883e3 Unbreak build bots
llvm-svn: 231536
2015-03-06 23:56:30 +00:00
Greg Clayton 39fb1389b4 Make sure to re-read the file data you can get from OptionValueFileSpec::GetFileContents(...) when the file has changed.
This means you can set an expression prefix file with:
(lldb) settings set target.expr-prefix /tmp/to/prefix.txt

And you can run an expression and modify your expression prefix file in another editor without having to type:

(lldb) settings set target.expr-prefix /tmp/to/prefix.txt

again...

<rdar://problem/12155942> 

llvm-svn: 231535
2015-03-06 23:46:54 +00:00
David Majnemer 322fe4188f MS ABI: Stick throw-related data into the .xdata section
This is a little nicer as it keeps the contents of .xdata away from
normal .rdata; we expect .xdata to be far colder than .rdata.

llvm-svn: 231534
2015-03-06 23:45:23 +00:00
David Majnemer d3d7669ced MS ABI: Correctly generate throw-info for pointer to const qual types
We didn't create type info based on the unqualified pointee type,
causing RTTI mismatches.

llvm-svn: 231533
2015-03-06 23:45:20 +00:00
Richard Smith 6661a67d50 [modules] Mark Analysis/TargetLibraryInfo.def as a textual header.
llvm-svn: 231532
2015-03-06 23:39:54 +00:00
Frederic Riss 9833de65a7 [dsymutil] Support cloning DIE reference attributes.
Reference attributes are mainly handled by just creating DIEEntry
attributes for them. There is a special case for DW_FORM_ref_addr
attributes though, because the DIEEntry code needs a DwarfDebug
code to emit them (and we don't have one as we do no CodeGen).
In that case, just use DIEInteger attributes with the right form.

llvm-svn: 231531
2015-03-06 23:22:53 +00:00
Frederic Riss 9d441b68a3 [dsymutil] Set linked unit start offset early. NFC.
The start offset of a linked unit is known before starting to clone
its DIEs. Handling DW_FORM_ref_addr attributes requires that this
offset is set while cloning the unit. Split CompileUnit::computeOffsets()
into setStartOffset() and computeNextUnitOffset() and call them
repsectively before cloning the DIEs and right after.

llvm-svn: 231530
2015-03-06 23:22:50 +00:00
Frederic Riss 718c60e203 Add DIEInteger::setValue() method.
dsymutil needs to 'patch' attribute values after creating them. Just
add this trivial capability.

llvm-svn: 231529
2015-03-06 23:22:46 +00:00
Olivier Sallenave 049d803ce0 Do not restrict interleaved unrolling to small loops, depending on the target.
llvm-svn: 231528
2015-03-06 23:12:04 +00:00
Quentin Colombet 66b616351c [AArch64][LoadStoreOptimizer] Generate LDP + SXTW instead of LD[U]R + LD[U]RSW.
Teach the load store optimizer how to sign extend a result of a load pair when
it helps creating more pairs.
The rational is that loads are more expensive than sign extensions, so if we
gather some in one instruction this is better!

<rdar://problem/20072968>

llvm-svn: 231527
2015-03-06 22:42:10 +00:00