platform/upstream/llvm.git
9 years agoExecutionEngine: Preliminary support for dynamically loadable coff objects
David Majnemer [Sat, 7 Mar 2015 20:21:27 +0000 (20:21 +0000)]
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

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Sat, 7 Mar 2015 19:52:39 +0000 (19:52 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 231573

9 years agoMake constant arrays that are passed to functions as const.
Benjamin Kramer [Sat, 7 Mar 2015 17:41:00 +0000 (17:41 +0000)]
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

9 years agoRemove duplicate code. NFC.
Rui Ueyama [Sat, 7 Mar 2015 16:49:14 +0000 (16:49 +0000)]
Remove duplicate code. NFC.

llvm-svn: 231570

9 years agoUse SDValue bool check to tidyup some possible combines. NFC.
Simon Pilgrim [Sat, 7 Mar 2015 16:34:55 +0000 (16:34 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.

llvm-svn: 231569

9 years agoRemove redundant empty destructors.
Rui Ueyama [Sat, 7 Mar 2015 16:01:13 +0000 (16:01 +0000)]
Remove redundant empty destructors.

Both File and Atom have virtual destructors. We don't need to repeat
that in derived classes.

llvm-svn: 231568

9 years agoAdding parenthesis around logical expressions to silence a -Wparentheses warning...
Aaron Ballman [Sat, 7 Mar 2015 15:16:27 +0000 (15:16 +0000)]
Adding parenthesis around logical expressions to silence a -Wparentheses warning; NFC.

llvm-svn: 231567

9 years agoRemoving spurious semi-colons; NFC
Aaron Ballman [Sat, 7 Mar 2015 15:10:32 +0000 (15:10 +0000)]
Removing spurious semi-colons; NFC

llvm-svn: 231566

9 years agoX86: Roll repetitive code into a loop. NFC.
Benjamin Kramer [Sat, 7 Mar 2015 15:06:16 +0000 (15:06 +0000)]
X86: Roll repetitive code into a loop. NFC.

llvm-svn: 231565

9 years agoReapply r231508 "CodeGen: Emit constant temporaries into read-only globals."
Benjamin Kramer [Sat, 7 Mar 2015 13:37:13 +0000 (13:37 +0000)]
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

9 years ago[DAGCombiner] Fix wrong folding of AND dag nodes.
Andrea Di Biagio [Sat, 7 Mar 2015 12:24:55 +0000 (12:24 +0000)]
[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

9 years agoAdding sanitizer_symbolizer_win.h to CMakeLists.txt
Kuba Brecka [Sat, 7 Mar 2015 11:04:36 +0000 (11:04 +0000)]
Adding sanitizer_symbolizer_win.h to CMakeLists.txt

llvm-svn: 231562

9 years ago[Modules] Include the header needed for make_unique, otherwise we can't
Chandler Carruth [Sat, 7 Mar 2015 10:55:47 +0000 (10:55 +0000)]
[Modules] Include the header needed for make_unique, otherwise we can't
build this header in a module.

llvm-svn: 231561

9 years agoTeach the LLVM CMake build how to explicitly use libc++abi when using
Chandler Carruth [Sat, 7 Mar 2015 10:30:34 +0000 (10:30 +0000)]
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

9 years agoMuch like we silence warnings about -flto in many cases to facilitate
Chandler Carruth [Sat, 7 Mar 2015 10:01:29 +0000 (10:01 +0000)]
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

9 years ago[PM] Fixup for r231556 where I missed a dependency on intrinsics
Chandler Carruth [Sat, 7 Mar 2015 09:08:20 +0000 (09:08 +0000)]
[PM] Fixup for r231556 where I missed a dependency on intrinsics
generation.

llvm-svn: 231558

9 years agoUpdate makefile to reflect that the Passes directory is gone here.
Chandler Carruth [Sat, 7 Mar 2015 09:03:17 +0000 (09:03 +0000)]
Update makefile to reflect that the Passes directory is gone here.

llvm-svn: 231557

9 years ago[PM] Create a separate library for high-level pass management code.
Chandler Carruth [Sat, 7 Mar 2015 09:02:36 +0000 (09:02 +0000)]
[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

9 years ago[DAGCombiner] SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(V,C)) -> VECTOR_SHUFFLE
Simon Pilgrim [Sat, 7 Mar 2015 05:52:42 +0000 (05:52 +0000)]
[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

9 years ago[analyzer] RetainCountChecker: CF properties are always manually retain-counted.
Jordan Rose [Sat, 7 Mar 2015 05:47:24 +0000 (05:47 +0000)]
[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

9 years agoResolver: optimize fallback atoms.
Rui Ueyama [Sat, 7 Mar 2015 04:23:46 +0000 (04:23 +0000)]
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

9 years agoResolver: Reduce number of SymbolTable::isDefined function calls.
Rui Ueyama [Sat, 7 Mar 2015 03:55:32 +0000 (03:55 +0000)]
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

9 years agoMove Python Init from InitializeForLLGS to Initialize
Vince Harron [Sat, 7 Mar 2015 03:37:15 +0000 (03:37 +0000)]
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

9 years agoResolver: Reduce number of hash function call.
Rui Ueyama [Sat, 7 Mar 2015 03:22:37 +0000 (03:22 +0000)]
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

9 years ago[analyzer] Remove unused type (addition to r231540: "Revert changes from r229593")
Anton Yartsev [Sat, 7 Mar 2015 01:57:31 +0000 (01:57 +0000)]
[analyzer] Remove unused type (addition to r231540: "Revert changes from r229593")

llvm-svn: 231548

9 years agoTypo.
Eric Christopher [Sat, 7 Mar 2015 01:39:09 +0000 (01:39 +0000)]
Typo.

llvm-svn: 231547

9 years agoRemove use of misched-bench from this test and replace it with
Eric Christopher [Sat, 7 Mar 2015 01:39:06 +0000 (01:39 +0000)]
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

9 years agoPECOFF: Do not add extraneous symbols to the dead strip root.
Rui Ueyama [Sat, 7 Mar 2015 01:35:50 +0000 (01:35 +0000)]
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

9 years ago[dsymutil] Apply relocations to DIE data before cloning.
Frederic Riss [Sat, 7 Mar 2015 01:25:09 +0000 (01:25 +0000)]
[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

9 years agoRemove unused typedefs.
Rui Ueyama [Sat, 7 Mar 2015 01:04:40 +0000 (01:04 +0000)]
Remove unused typedefs.

llvm-svn: 231543

9 years agoUse multimap<T, U> instead of map<T, set<U>>. NFC.
Rui Ueyama [Sat, 7 Mar 2015 01:00:44 +0000 (01:00 +0000)]
Use multimap<T, U> instead of map<T, set<U>>. NFC.

llvm-svn: 231542

9 years agoRevert r231508 "CodeGen: Emit constant temporaries into read-only globals."
Hans Wennborg [Sat, 7 Mar 2015 00:46:19 +0000 (00:46 +0000)]
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

9 years ago[analyzer] Revert changes from r229593; an enhancement is under discussion
Anton Yartsev [Sat, 7 Mar 2015 00:31:53 +0000 (00:31 +0000)]
[analyzer] Revert changes from r229593; an enhancement is under discussion

llvm-svn: 231540

9 years agoRecommit r231324 with a fix to the ARM execution domain code
Eric Christopher [Sat, 7 Mar 2015 00:12:22 +0000 (00:12 +0000)]
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

9 years agoReplace Sema's map of locally-scoped extern "C" declarations with a DeclContext
Richard Smith [Sat, 7 Mar 2015 00:04:49 +0000 (00:04 +0000)]
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

9 years agoHelp for _regexp-break wasn't very clear. Added more detailed explanations of all...
Greg Clayton [Sat, 7 Mar 2015 00:01:46 +0000 (00:01 +0000)]
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

9 years agoUnbreak build bots
David Majnemer [Fri, 6 Mar 2015 23:56:30 +0000 (23:56 +0000)]
Unbreak build bots

llvm-svn: 231536

9 years agoMake sure to re-read the file data you can get from OptionValueFileSpec::GetFileConte...
Greg Clayton [Fri, 6 Mar 2015 23:46:54 +0000 (23:46 +0000)]
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

9 years agoMS ABI: Stick throw-related data into the .xdata section
David Majnemer [Fri, 6 Mar 2015 23:45:23 +0000 (23:45 +0000)]
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

9 years agoMS ABI: Correctly generate throw-info for pointer to const qual types
David Majnemer [Fri, 6 Mar 2015 23:45:20 +0000 (23:45 +0000)]
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

9 years ago[modules] Mark Analysis/TargetLibraryInfo.def as a textual header.
Richard Smith [Fri, 6 Mar 2015 23:39:54 +0000 (23:39 +0000)]
[modules] Mark Analysis/TargetLibraryInfo.def as a textual header.

llvm-svn: 231532

9 years ago[dsymutil] Support cloning DIE reference attributes.
Frederic Riss [Fri, 6 Mar 2015 23:22:53 +0000 (23:22 +0000)]
[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

9 years ago[dsymutil] Set linked unit start offset early. NFC.
Frederic Riss [Fri, 6 Mar 2015 23:22:50 +0000 (23:22 +0000)]
[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

9 years agoAdd DIEInteger::setValue() method.
Frederic Riss [Fri, 6 Mar 2015 23:22:46 +0000 (23:22 +0000)]
Add DIEInteger::setValue() method.

dsymutil needs to 'patch' attribute values after creating them. Just
add this trivial capability.

llvm-svn: 231529

9 years agoDo not restrict interleaved unrolling to small loops, depending on the target.
Olivier Sallenave [Fri, 6 Mar 2015 23:12:04 +0000 (23:12 +0000)]
Do not restrict interleaved unrolling to small loops, depending on the target.

llvm-svn: 231528

9 years ago[AArch64][LoadStoreOptimizer] Generate LDP + SXTW instead of LD[U]R + LD[U]RSW.
Quentin Colombet [Fri, 6 Mar 2015 22:42:10 +0000 (22:42 +0000)]
[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

9 years agoImprove ValueObject::GetValueDidChange test; Add a comment for it
Ilia K [Fri, 6 Mar 2015 22:35:08 +0000 (22:35 +0000)]
Improve ValueObject::GetValueDidChange test; Add a comment for it

Summary: This patch adds a few comments for GetValueDidChange and contains improvements for TestValueVarUpdate.py test which checks ValueObject::GetValueDidChange for complex types.

Reviewers: zturner, granata.enrico, clayborg

Reviewed By: clayborg

Subscribers: jingham, lldb-commits, granata.enrico, zturner, clayborg

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

llvm-svn: 231526

9 years agoFix -var-create and -var-update (MI)
Ilia K [Fri, 6 Mar 2015 22:25:12 +0000 (22:25 +0000)]
Fix -var-create and -var-update (MI)

Summary:
This patch includes:
* Fix -var-create command for global/static variables
* Fix -var-update command: remove m_strValueName/m_eVarInfoFormat/m_bValueChanged{Array,Composite,Normal}Type;  clean CMICmdCmdVarUpdate::Execute and CMICmdCmdVarUpdate::Acknowledge; improve CMICmdCmdVarUpdate::MIFormResponse; Complete the value after -var-create using the CMICmdCmdVarCreate::CompleteSBValue to get SBValue::GetValueDidChange work.
* Add non-constant version of CMICmnLLDBDebugSessionInfoVarObj::GetValue
* Add MiVarTestCase.test_lldbmi_var_update test

All tests pass on OS X.

Reviewers: abidh, emaste, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, emaste, clayborg, abidh

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

llvm-svn: 231525

9 years agofixed to test features, not CPUs
Sanjay Patel [Fri, 6 Mar 2015 21:50:42 +0000 (21:50 +0000)]
fixed to test features, not CPUs

llvm-svn: 231524

9 years agofixed to test features, not CPUs
Sanjay Patel [Fri, 6 Mar 2015 21:50:27 +0000 (21:50 +0000)]
fixed to test features, not CPUs

llvm-svn: 231523

9 years agoloosen checking for buildbots
Sanjay Patel [Fri, 6 Mar 2015 21:30:18 +0000 (21:30 +0000)]
loosen checking for buildbots

llvm-svn: 231522

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Fri, 6 Mar 2015 21:24:56 +0000 (21:24 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 231521

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Fri, 6 Mar 2015 21:19:32 +0000 (21:19 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 231520

9 years agofixed test to use FileCheck
Sanjay Patel [Fri, 6 Mar 2015 21:16:15 +0000 (21:16 +0000)]
fixed test to use FileCheck

llvm-svn: 231519

9 years agoResolver: move code inside an assert.
Rui Ueyama [Fri, 6 Mar 2015 21:15:06 +0000 (21:15 +0000)]
Resolver: move code inside an assert.

llvm-svn: 231518

9 years agofixed to use CHECK-LABELs
Sanjay Patel [Fri, 6 Mar 2015 21:05:02 +0000 (21:05 +0000)]
fixed to use CHECK-LABELs

llvm-svn: 231517

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Fri, 6 Mar 2015 20:58:15 +0000 (20:58 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 231516

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Fri, 6 Mar 2015 20:57:40 +0000 (20:57 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 231515

9 years agoRemember to set m_loaded_objc_opt once you've loaded the ObjC data
Jim Ingham [Fri, 6 Mar 2015 20:57:17 +0000 (20:57 +0000)]
Remember to set m_loaded_objc_opt once you've loaded the ObjC data
from the shared cache so you don't update it over & over.

<rdar://problem/20074768>

llvm-svn: 231514

9 years agofixed to test feature, not CPU
Sanjay Patel [Fri, 6 Mar 2015 20:51:25 +0000 (20:51 +0000)]
fixed to test feature, not CPU

llvm-svn: 231513

9 years agofixed to test features, not CPUs
Sanjay Patel [Fri, 6 Mar 2015 20:46:16 +0000 (20:46 +0000)]
fixed to test features, not CPUs

llvm-svn: 231512

9 years agoRemove Host::Backtrace in favor of llvm::sys::PrintStackTrace()
Zachary Turner [Fri, 6 Mar 2015 20:45:43 +0000 (20:45 +0000)]
Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()

This removes Host::Backtrace from the codebase, and changes all
call sites to use llvm::sys::PrintStackTrace().  This makes the
functionality available for all platforms, and even for platforms
which currently had a supported implementation of Host::Backtrace,
this patch should enable richer information in stack traces, such
as file and line number information, as well as giving it the
ability to unwind through inlined functions.

llvm-svn: 231511

9 years agofixed test to use SSE2 attribute
Sanjay Patel [Fri, 6 Mar 2015 20:38:55 +0000 (20:38 +0000)]
fixed test to use SSE2 attribute

llvm-svn: 231510

9 years agofixed to test only the feature, not the feature and a CPU
Sanjay Patel [Fri, 6 Mar 2015 20:34:20 +0000 (20:34 +0000)]
fixed to test only the feature, not the feature and a CPU

llvm-svn: 231509

9 years agoCodeGen: Emit constant temporaries into read-only globals.
Benjamin Kramer [Fri, 6 Mar 2015 20:00:03 +0000 (20:00 +0000)]
CodeGen: Emit constant temporaries into read-only globals.

Instead of creating a copy on the stack just stash them in a private
constant global. This saves both the copying overhead and the stack
space, and gives the optimizer more room to constant fold.

This tries to make array temporaries more similar to regular arrays,
they can't use the same logic because a temporary has no VarDecl to be
bound to so we roll our own version here.

The original use case for this optimization was code like
  for (int i : {1, 2, 3, 4, 5, 6, 7, 8, 10})
    foo(i);
where without this patch (assuming that the loop is not unrolled) we
would alloca an array on the stack, copy the 10 values over and
iterate on that. With this patch we put the array in .text use it
directly. Apart from that case this helps on virtually any passing of
a constant std::initializer_list as a function argument.

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

llvm-svn: 231508

9 years agoDAGCombiner: Canonicalize select(and/or,x,y) depending on target.
Matthias Braun [Fri, 6 Mar 2015 19:49:10 +0000 (19:49 +0000)]
DAGCombiner: Canonicalize select(and/or,x,y) depending on target.

This is based on the following equivalences:
select(C0 & C1, X, Y) <=> select(C0, select(C1, X, Y), Y)
select(C0 | C1, X, Y) <=> select(C0, X, select(C1, X, Y))

Many target cannot perform and/or on the CPU flags and therefore the
right side should be choosen to avoid materializign the i1 flags in an
integer register. If the target can perform this operation efficiently
we normalize to the left form.

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

llvm-svn: 231507

9 years agoDAGCombiner: Factor out some and/or combines.
Matthias Braun [Fri, 6 Mar 2015 19:49:06 +0000 (19:49 +0000)]
DAGCombiner: Factor out some and/or combines.

This is in preparation for changing visitSELECT to normalize towards
select(Cond0, select(Cond1, X, Y), Y);
select(Cond0, X, select(Cond1, X, Y)) which perfom an implicit and/or of
the conditions.

The factored function contains all DAGCombine rules which reduce two values
combined by an And/Or operation to a single value. This does not include rules
involving constants as visitSELECT already handles that case.

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

llvm-svn: 231506

9 years ago[AsmPrinter][TLOF] Remove AArch64 test to appease buildbots
Bruno Cardoso Lopes [Fri, 6 Mar 2015 19:42:18 +0000 (19:42 +0000)]
[AsmPrinter][TLOF] Remove AArch64 test to appease buildbots

Follow up from r231497. Using XFAIL would still trigger fail on some
buildbots. Will re-introduce it as soon as I have a fix.

llvm-svn: 231505

9 years agoA few improvements to our vector types formatting story:
Enrico Granata [Fri, 6 Mar 2015 19:37:57 +0000 (19:37 +0000)]
A few improvements to our vector types formatting story:
- use a hardcoded formatter to match all vector types, and make it so that their element type is taken into account when doing default formatting
- special case a vector of char to display byte values instead of characters by default

Fixes the test failures Ilia was seeing

llvm-svn: 231504

9 years agoLoopInterchange: Remove empty method.
Benjamin Kramer [Fri, 6 Mar 2015 19:37:26 +0000 (19:37 +0000)]
LoopInterchange: Remove empty method.

llvm-svn: 231503

9 years ago[asan] Fix 2 problems in nohugepage_test.
Kostya Serebryany [Fri, 6 Mar 2015 19:33:58 +0000 (19:33 +0000)]
[asan] Fix 2 problems in nohugepage_test.

1. /proc/self/smaps may be bigger than 1 << 14.  On my machine, it is
26KB.
2. The read system call may return a partially filled buffer.  We need
to check the return value from read.

Patch by H.J. Lu

llvm-svn: 231502

9 years agoLoopInterchange: Rephrase instruction moving using ilist's splice and factor it into...
Benjamin Kramer [Fri, 6 Mar 2015 18:59:14 +0000 (18:59 +0000)]
LoopInterchange: Rephrase instruction moving using ilist's splice and factor it into a function

+ Random cleanups. No functional change.

llvm-svn: 231501

9 years agoExecutionDepsFix: Indizes -> Indices.
Matthias Braun [Fri, 6 Mar 2015 18:56:20 +0000 (18:56 +0000)]
ExecutionDepsFix: Indizes -> Indices.

Translate german to english.

llvm-svn: 231500

9 years agoMS ABI: Insert copy-constructors into the CatchableType
David Majnemer [Fri, 6 Mar 2015 18:53:55 +0000 (18:53 +0000)]
MS ABI: Insert copy-constructors into the CatchableType

Find all unambiguous public classes of the exception object's class type
and reference all of their copy constructors.  Yes, this is not
conforming but it is necessary in order to implement their ABI.  This is
because the copy constructor is actually referenced by the metadata
describing which catch handlers are eligible to handle the exception
object.

N.B.  This doesn't yet handle the copy constructor closure case yet,
that work is ongoing.

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

llvm-svn: 231499

9 years agoOops. This arg is passed, just ignored.
Dan Albert [Fri, 6 Mar 2015 18:51:25 +0000 (18:51 +0000)]
Oops. This arg is passed, just ignored.

We should probably be using this argument to find the data files for
the tests, but that isn't implemented yet.

llvm-svn: 231498

9 years ago[AsmPrinter][TLOF] XFAIL AArch64 test to appease buildbots
Bruno Cardoso Lopes [Fri, 6 Mar 2015 18:38:42 +0000 (18:38 +0000)]
[AsmPrinter][TLOF] XFAIL AArch64 test to appease buildbots

The checking for extgotequiv and localgotequiv rely on the emission
order, which is not guaranteed because we use DenseMap to hold the GOT
equivalents. XFAIL this now until I get time to use MapVector and test
out the solution. In the meantime, appease buildbots.

llvm-svn: 231497

9 years agoFix the PrefixExecutor.
Dan Albert [Fri, 6 Mar 2015 18:35:45 +0000 (18:35 +0000)]
Fix the PrefixExecutor.

The PrefixExecutor wasn't passing the exe_path down the chain, so the
command was overriding that, the work_dir was being passed as the
command, and so on.

I've cleaned up a few pylint issues while I was here.

llvm-svn: 231496

9 years agoFix typo.
Eric Christopher [Fri, 6 Mar 2015 18:20:23 +0000 (18:20 +0000)]
Fix typo.

llvm-svn: 231495

9 years agoSema: The i8 suffix should yield a literal of type char
David Majnemer [Fri, 6 Mar 2015 18:04:22 +0000 (18:04 +0000)]
Sema: The i8 suffix should yield a literal of type char

We would make i8 literals turn into signed char instead of char.  This
is incompatible with MSVC.

This fixes PR22824.

llvm-svn: 231494

9 years ago[dsymutil] Add debug_str construction support.
Frederic Riss [Fri, 6 Mar 2015 17:56:30 +0000 (17:56 +0000)]
[dsymutil] Add debug_str construction support.

With this comes the ability to correctly clone string attributes in DIEs.

llvm-svn: 231493

9 years ago[asan] Allow users of asan_symbolize.py to forbid fallback to atos/addr2line.
Sergey Matveev [Fri, 6 Mar 2015 17:05:28 +0000 (17:05 +0000)]
[asan] Allow users of asan_symbolize.py to forbid fallback to atos/addr2line.

llvm-svn: 231492

9 years agoR600/SI: Remove unused register class
Tom Stellard [Fri, 6 Mar 2015 17:00:16 +0000 (17:00 +0000)]
R600/SI: Remove unused register class

llvm-svn: 231491

9 years agoFix Radar10642615DataFormatterTestCase after r231449
Ilia K [Fri, 6 Mar 2015 16:53:37 +0000 (16:53 +0000)]
Fix Radar10642615DataFormatterTestCase after r231449

Summary:
I'm not sure that this failure should be fixed by modifying this test.
It seems strange for me that the only one type vUInt8 is printed with '0x' prefix.

This patch fixes the following error:
```
======================================================================
FAIL: test_with_dsym_and_run_command (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
   Test data formatter commands.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 456, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 21, in test_with_dsym_and_run_command
    self.data_formatter_commands()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 68, in data_formatter_commands
    '(vBool32) valueBool32 = (0, 1, 0, 1)'])
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2100, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '(vUInt8) valueU8 = ('\x01', '\0', '\x04', '\0', '\0', '\x01', '\0', '\x04', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0')' returns expected result
Config=x86_64-clang
======================================================================
FAIL: test_with_dwarf_and_run_command (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
   Test data formatter commands.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 473, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 28, in test_with_dwarf_and_run_command
    self.data_formatter_commands()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 68, in data_formatter_commands
    '(vBool32) valueBool32 = (0, 1, 0, 1)'])
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2100, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '(vUInt8) valueU8 = ('\x01', '\0', '\x04', '\0', '\0', '\x01', '\0', '\x04', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0')' returns expected result
Config=x86_64-clang
----------------------------------------------------------------------
```

Reviewers: granata.enrico, zturner, clayborg

Subscribers: clayborg, lldb-commits, zturner, granata.enrico

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

llvm-svn: 231490

9 years agoFix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_remote test after r231479
Ilia K [Fri, 6 Mar 2015 16:43:38 +0000 (16:43 +0000)]
Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_remote test after r231479

llvm-svn: 231489

9 years agoSema: We can use delegating ctors now. NFC.
Benjamin Kramer [Fri, 6 Mar 2015 16:36:50 +0000 (16:36 +0000)]
Sema: We can use delegating ctors now. NFC.

llvm-svn: 231488

9 years agoFix isOverride() for the case of a dependent typed base class.
Samuel Benzaquen [Fri, 6 Mar 2015 16:24:47 +0000 (16:24 +0000)]
Fix isOverride() for the case of a dependent typed base class.

The method decl is not marked as overriding any other method decls
until the template is instantiated.
Use the override attribute as another signal.

llvm-svn: 231487

9 years agoFold init() helpers into constructors. NFC.
Benjamin Kramer [Fri, 6 Mar 2015 16:21:15 +0000 (16:21 +0000)]
Fold init() helpers into constructors. NFC.

llvm-svn: 231486

9 years agoAvoid calls to dumpPassInfo and RegionBase<Tr>::getNameStr() in RGPassManager if
Chad Rosier [Fri, 6 Mar 2015 16:15:04 +0000 (16:15 +0000)]
Avoid calls to dumpPassInfo and RegionBase<Tr>::getNameStr() in RGPassManager if
-debug-pass is not specified, as the string is only used when dumping pass
information.  There is a big cost of determining the name in
ReginBase<Tr>:getNameStr() if the region's entry or exit block doesn't have a
name.  This is the case for the Release build, as names are not preserved by the
front-end.

RegionPass is mainly used by Polly, resulting in long compile time for one file
of a customer application with the Release build (1m24s) vs Release+Asserts
build (10s) when Polly is used.  With this change, the compile time with the
Release build went down to 8s.

Patch by Sanjin Sijaric <ssijaric@codeaurora.org>!
Phabricator: http://reviews.llvm.org/D8076

llvm-svn: 231485

9 years ago[ConstantRange] Teach multiply to be cleverer about signed ranges.
James Molloy [Fri, 6 Mar 2015 15:50:47 +0000 (15:50 +0000)]
[ConstantRange] Teach multiply to be cleverer about signed ranges.

Multiplication is not dependent on signedness, so just treating
all input ranges as unsigned is not incorrect. However it will cause
overly pessimistic ranges (such as full-set) when used with signed
negative values.

Teach multiply to try to interpret its inputs as both signed and
unsigned, and then to take the most specific (smallest population)
as its result.

llvm-svn: 231483

9 years agoInitialize ProcessPOSIXLog by NativeProcessLinux
Tamas Berghammer [Fri, 6 Mar 2015 15:47:23 +0000 (15:47 +0000)]
Initialize ProcessPOSIXLog by NativeProcessLinux

Previously it was initialized by ProcessLinux but lldb-server don't
contain ProcessLinux anymore so it have to be initialized by
NativeProcessLinux also.

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

llvm-svn: 231482

9 years ago[AsmPrinter][TLOF] Make AArch64 test a bit more flexible
Bruno Cardoso Lopes [Fri, 6 Mar 2015 15:11:41 +0000 (15:11 +0000)]
[AsmPrinter][TLOF] Make AArch64 test a bit more flexible

llvm-svn: 231481

9 years ago[AsmPrinter][TLOF] Split tests and move to appropriate directories
Bruno Cardoso Lopes [Fri, 6 Mar 2015 14:41:56 +0000 (14:41 +0000)]
[AsmPrinter][TLOF] Split tests and move to appropriate directories

Follow up from r231474 and 231475 to appease buildbots

llvm-svn: 231480

9 years agoRename test/tools/lldb-gdbserver to test/tools/lldb-server
Robert Flack [Fri, 6 Mar 2015 14:36:33 +0000 (14:36 +0000)]
Rename test/tools/lldb-gdbserver to test/tools/lldb-server

As requested in http://reviews.llvm.org/D7545 this change moves test/tools/lldb-gdbserver to test/tools/lldb-server ot match the name of the target being tested.

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

llvm-svn: 231479

9 years agoSymbolizer refactoring: Make WinSymbolizer use SymbolizerTool interface
Kuba Brecka [Fri, 6 Mar 2015 14:33:56 +0000 (14:33 +0000)]
Symbolizer refactoring: Make WinSymbolizer use SymbolizerTool interface

Reviewed at http://reviews.llvm.org/D8089

llvm-svn: 231478

9 years agoRemoving code that is unused after r231424; NFC.
Aaron Ballman [Fri, 6 Mar 2015 14:24:53 +0000 (14:24 +0000)]
Removing code that is unused after r231424; NFC.

llvm-svn: 231477

9 years agoUse delegating ctors to reduce code duplication. NFC.
Benjamin Kramer [Fri, 6 Mar 2015 14:15:57 +0000 (14:15 +0000)]
Use delegating ctors to reduce code duplication. NFC.

llvm-svn: 231476

9 years ago[AsmPrinter][TLOF] 32-bit MachO support for replacing GOT equivalents
Bruno Cardoso Lopes [Fri, 6 Mar 2015 13:49:05 +0000 (13:49 +0000)]
[AsmPrinter][TLOF] 32-bit MachO support for replacing GOT equivalents

Add MachO 32-bit (i.e. arm and x86) support for replacing global GOT equivalent
symbol accesses. Unlike 64-bit targets, there's no GOTPCREL relocation, and
access through a non_lazy_symbol_pointers section is used instead.

-- before

    _extgotequiv:
       .long _extfoo

    _delta:
       .long _extgotequiv-_delta

-- after

    _delta:
       .long L_extfoo$non_lazy_ptr-_delta

       .section __IMPORT,__pointers,non_lazy_symbol_pointers
    L_extfoo$non_lazy_ptr:
       .indirect_symbol _extfoo
       .long 0

llvm-svn: 231475

9 years ago[AsmPrinter][TLOF] ARM64 MachO support for replacing GOT equivalents
Bruno Cardoso Lopes [Fri, 6 Mar 2015 13:48:45 +0000 (13:48 +0000)]
[AsmPrinter][TLOF] ARM64 MachO support for replacing GOT equivalents

Follow up r230264 and add ARM64 support for replacing global GOT
equivalent symbol accesses by references to the GOT entry for the final
symbol instead, example:

-- before

   .globl  _foo
  _foo:
   .long   42

   .globl  _gotequivalent
  _gotequivalent:
   .quad   _foo

   .globl  _delta
  _delta:
   .long   _gotequivalent-_delta

-- after

   .globl  _foo
  _foo:
   .long   42

   .globl  _delta
  Ltmp3:
   .long _foo@GOT-Ltmp3

llvm-svn: 231474

9 years agoCodingStyle: Allow delegating ctors
Benjamin Kramer [Fri, 6 Mar 2015 13:46:50 +0000 (13:46 +0000)]
CodingStyle: Allow delegating ctors

Delegating constructors seem to work fine with all supported compilers.

llvm-svn: 231473

9 years ago[mips] [IAS] Add missing constraints and improve testing for the .module directive.
Toma Tabacu [Fri, 6 Mar 2015 12:15:12 +0000 (12:15 +0000)]
[mips] [IAS] Add missing constraints and improve testing for the .module directive.

Summary:
None of the .set directives can be used before the .module directives. The .set mips0/pop/push were not triggering this constraint.
Also added testing for all the other implemented directives which are supposed to trigger this constraint.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 231465