platform/upstream/llvm.git
9 years agoFix the test to disassemble as if at address zero, not at an invalid address. The...
Greg Clayton [Tue, 27 Jan 2015 00:22:36 +0000 (00:22 +0000)]
Fix the test to disassemble as if at address zero, not at an invalid address. The default SBAddress constructor sets the offset to 0xffffffffffffffff and the section to NULL.

This was causing problems on clang 602 branches that use MemoryObjects to as the container for opcode bytes instead of a plain array of bytes. So we were asking for 3 bytes to be disassembled at address 0xffffffffffffffff which would cause an unsigned overflow and cause the MemoryObject to refuse to read anymore bytes.

llvm-svn: 227153

9 years agoReplace this testcase with an even shorter one provided by dblaikie.
Adrian Prantl [Tue, 27 Jan 2015 00:22:17 +0000 (00:22 +0000)]
Replace this testcase with an even shorter one provided by dblaikie.

llvm-svn: 227152

9 years agoCommoning of target specific load/store intrinsics in Early CSE.
Chad Rosier [Mon, 26 Jan 2015 22:51:15 +0000 (22:51 +0000)]
Commoning of target specific load/store intrinsics in Early CSE.

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

llvm-svn: 227149

9 years agoPete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl...
Chris Bieneman [Mon, 26 Jan 2015 22:50:47 +0000 (22:50 +0000)]
Pete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl. Also adding a test case.

llvm-svn: 227148

9 years agoFix local variable names.
Rui Ueyama [Mon, 26 Jan 2015 22:47:52 +0000 (22:47 +0000)]
Fix local variable names.

llvm-svn: 227147

9 years agoAdd test cases for PRE w/volatile loads
Philip Reames [Mon, 26 Jan 2015 22:40:44 +0000 (22:40 +0000)]
Add test cases for PRE w/volatile loads

These tests check that the combination of 227110 (cross block query inst) and 227112 (volatile load semantics) work together properly to allow PRE in cases where a loop contains a volatile access.

llvm-svn: 227146

9 years ago[X86][SSE] Float comparisons can sometimes be safely commuted
Simon Pilgrim [Mon, 26 Jan 2015 22:29:24 +0000 (22:29 +0000)]
[X86][SSE] Float comparisons can sometimes be safely commuted

For ordered, unordered, equal and not-equal tests, packed float and double comparison instructions can be safely commuted without affecting the results. This patch checks the comparison mode of the (v)cmpps + (v)cmppd instructions and commutes the result if it can.

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

llvm-svn: 227145

9 years agoAccept -allow-shlib-undefined in addition to --allow-shlib-undefined.
Rui Ueyama [Mon, 26 Jan 2015 22:13:53 +0000 (22:13 +0000)]
Accept -allow-shlib-undefined in addition to --allow-shlib-undefined.

GNU LD accepts both. CMake seems to use the former than the latter.

llvm-svn: 227144

9 years agoHave the UTF conversion wrappers append a null terminator.
Zachary Turner [Mon, 26 Jan 2015 22:05:50 +0000 (22:05 +0000)]
Have the UTF conversion wrappers append a null terminator.

This is especially useful for the UTF8 -> UTF16 direction, since
there is no equivalent of llvm::SmallString<> for wide characters.
This means that anyone who wants a null terminated string is forced
to manually push and pop their own null terminator.

Reviewed by: Reid Kleckner.

llvm-svn: 227143

9 years agoAdopt CMake policy CMP0042. Set MACOSX_RPATH on by default.
Eric Fiselier [Mon, 26 Jan 2015 22:00:30 +0000 (22:00 +0000)]
Adopt CMake policy CMP0042. Set MACOSX_RPATH on by default.

llvm-svn: 227142

9 years ago[X86][PCLMUL] Enable commutation for PCLMUL instructions
Simon Pilgrim [Mon, 26 Jan 2015 22:00:18 +0000 (22:00 +0000)]
[X86][PCLMUL] Enable commutation for PCLMUL instructions

Patch to allow (v)pclmulqdq to be commuted - swaps the src registers and inverts the immediate (low/high) src mask.

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

llvm-svn: 227141

9 years agoAdd new HideUnrelatedOptions API that takes a SmallVectorImpl.
Chris Bieneman [Mon, 26 Jan 2015 21:57:29 +0000 (21:57 +0000)]
Add new HideUnrelatedOptions API that takes a SmallVectorImpl.

Need a new API for clang-modernize that allows specifying a list of option categories to remain visible. This will allow clang-modernize to move off getRegisteredOptions.

llvm-svn: 227140

9 years agoAdopt CMake policy CMP0042. Set MACOSX_RPATH on by default.
Eric Fiselier [Mon, 26 Jan 2015 21:56:45 +0000 (21:56 +0000)]
Adopt CMake policy CMP0042. Set MACOSX_RPATH on by default.

llvm-svn: 227139

9 years agoLine endings fix. NFC.
Simon Pilgrim [Mon, 26 Jan 2015 21:28:32 +0000 (21:28 +0000)]
Line endings fix. NFC.

llvm-svn: 227138

9 years agoR600: Cleanup or test
Matt Arsenault [Mon, 26 Jan 2015 21:16:10 +0000 (21:16 +0000)]
R600: Cleanup or test

Fix broken check lines, use multiple check prefixes,
add an additional test for i1 or.

llvm-svn: 227137

9 years agoLine endings fix. NFC.
Simon Pilgrim [Mon, 26 Jan 2015 21:15:42 +0000 (21:15 +0000)]
Line endings fix. NFC.

llvm-svn: 227136

9 years agoDon't generate llvm.expect intrinsics with -O0.
Pete Cooper [Mon, 26 Jan 2015 20:51:58 +0000 (20:51 +0000)]
Don't generate llvm.expect intrinsics with -O0.

The backend won't run LowerExpect on -O0.  In a debug LTO build, this results in llvm.expect intrinsics being in the LTO IR which doesn't know how to optimize them.

Thanks to Chandler for the suggestion and review.

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

llvm-svn: 227135

9 years agoFix shared library build
Greg Fitzgerald [Mon, 26 Jan 2015 20:46:47 +0000 (20:46 +0000)]
Fix shared library build

* Removed cyclic dependency between lldPECOFF and lldDriver
* Added missing dependencies in unit tests

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

llvm-svn: 227134

9 years agobpf: fix build due to 'Move DataLayout back to the TargetMachine'
Alexei Starovoitov [Mon, 26 Jan 2015 20:43:15 +0000 (20:43 +0000)]
bpf: fix build due to 'Move DataLayout back to the TargetMachine'

commit r227113 moved DataLayout

llvm-svn: 227133

9 years agoUse parallel_sort in the LayoutPass.
Rui Ueyama [Mon, 26 Jan 2015 20:18:37 +0000 (20:18 +0000)]
Use parallel_sort in the LayoutPass.

Time to link lld using lld improved from 5.7s to 5.4s on Windows.
It's not a significant improvement but not bad for one-line change.

This patch includes a bug fix for Parallel.h as the original code
uses operator< instead of a compare function there.

llvm-svn: 227132

9 years agoAdded test for incomplete type support in vector/list/forward_list. References PR...
Marshall Clow [Mon, 26 Jan 2015 20:06:52 +0000 (20:06 +0000)]
Added test for incomplete type support in vector/list/forward_list. References PR#17980

llvm-svn: 227131

9 years ago[x86][MMX] Rename and cleanup tests: arith, intrinsics and shuffle
Bruno Cardoso Lopes [Mon, 26 Jan 2015 20:06:51 +0000 (20:06 +0000)]
[x86][MMX] Rename and cleanup tests: arith, intrinsics and shuffle

- Rename mmx-builtins to mmx-intrinsics to match other intrinsic test naming.
- Remove tests that duplicate functionality from mmx-intrinsics.ll.
- Move arith related tests to mmx-arith.ll.
- MMX related shuffle goes to vector-shuffle-mmx.ll.

llvm-svn: 227130

9 years agoTweak r227115 per review feedback
Ben Langmuir [Mon, 26 Jan 2015 20:01:17 +0000 (20:01 +0000)]
Tweak r227115 per review feedback

Use getAsArrayTypeUnsafe() instead of getUnqualifiedDesugaredType() to
get the underlying ArrayType.

llvm-svn: 227129

9 years agoFix broken doc link to Clang 3.5 release notes
Reid Kleckner [Mon, 26 Jan 2015 19:53:16 +0000 (19:53 +0000)]
Fix broken doc link to Clang 3.5 release notes

We appear to use 3.5.0 in the directory structure now. That's probably
unnecessary. We should probably let the micro releases update the docs
for the same minor version.

llvm-svn: 227127

9 years agoSimplifyCFG: Omit range checks for switch lookup tables when default is unreachable
Hans Wennborg [Mon, 26 Jan 2015 19:52:34 +0000 (19:52 +0000)]
SimplifyCFG: Omit range checks for switch lookup tables when default is unreachable

The range check would get optimized away later, but we might as well not emit
them in the first place.

http://reviews.llvm.org/D6471

llvm-svn: 227126

9 years agoSimplifyCFG: don't remove unreachable default switch destinations
Hans Wennborg [Mon, 26 Jan 2015 19:52:32 +0000 (19:52 +0000)]
SimplifyCFG: don't remove unreachable default switch destinations

An unreachable default destination can be exploited by other optimizations and
allows for more efficient lowering. Both the SDag switch lowering and
LowerSwitch can exploit unreachable defaults.

Also make TurnSwitchRangeICmp handle switches with unreachable default.
This is kind of separate change, but it cannot be tested without the change
above, and I don't want to land the change above without this since that would
regress other tests.

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

llvm-svn: 227125

9 years agoMake ConstantFoldTerminator() handle switches with unreachable default.
Hans Wennborg [Mon, 26 Jan 2015 19:52:24 +0000 (19:52 +0000)]
Make ConstantFoldTerminator() handle switches with unreachable default.

Tested by Transforms/SimplifyCFG/switch-to-br.ll's @unreachable function.

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

llvm-svn: 227124

9 years ago[NVPTX] Generate a more optimal sequence for select of i1
Justin Holewinski [Mon, 26 Jan 2015 19:52:20 +0000 (19:52 +0000)]
[NVPTX] Generate a more optimal sequence for select of i1

Instead of creating a pattern like "(p && a) || ((!p) && b)",
just expand the i8 operands to i32 and perform the selp on them.

Fixes PR22246

llvm-svn: 227123

9 years agoAdd a UTF8 to UTF16 conversion wrapper for use in the pdb dumper
Reid Kleckner [Mon, 26 Jan 2015 19:51:00 +0000 (19:51 +0000)]
Add a UTF8 to UTF16 conversion wrapper for use in the pdb dumper

This can also be used instead of the WindowsSupport.h ConvertUTF8ToUTF16
helpers, but that will require massaging some character types. The
Windows support routines want wchar_t output, but wchar_t is often 32
bits on non-Windows OSs.

llvm-svn: 227122

9 years agoCache the lookup of TargetLowering in the atomic expand pass.
Eric Christopher [Mon, 26 Jan 2015 19:45:40 +0000 (19:45 +0000)]
Cache the lookup of TargetLowering in the atomic expand pass.

llvm-svn: 227121

9 years agoAdd an overload of SetValueFromCString() to ValueObjectSynthetic that is just a passt...
Enrico Granata [Mon, 26 Jan 2015 19:33:52 +0000 (19:33 +0000)]
Add an overload of SetValueFromCString() to ValueObjectSynthetic that is just a passthrough to the parent object

Without this overload, attempts to edit the value of a variable with synthetic children enabled would change the value inside the synthetic ValueObject, but not propagate the changes to the underlying storage, hence resulting in no write for any meaningful purpose

Comes with a test case, and fixes rdar://19586311

llvm-svn: 227120

9 years ago[SelectionDAG] Fix assert message copypasta. NFC.
Ahmed Bougacha [Mon, 26 Jan 2015 19:31:42 +0000 (19:31 +0000)]
[SelectionDAG] Fix assert message copypasta. NFC.

llvm-svn: 227119

9 years agoAdd a FIXME about preferred alignment to DataLayout.
Eric Christopher [Mon, 26 Jan 2015 19:19:04 +0000 (19:19 +0000)]
Add a FIXME about preferred alignment to DataLayout.

Essentially DataLayout is global and affects the layout of ABI
level objects. Preferred alignment could change on a per function
basis as we change CPU features.

llvm-svn: 227118

9 years ago[NVPTX] Handle floating-point conversion patterns that are not explicitly ordered...
Justin Holewinski [Mon, 26 Jan 2015 19:11:20 +0000 (19:11 +0000)]
[NVPTX] Handle floating-point conversion patterns that are not explicitly ordered or unordered

Fixes PR22322

llvm-svn: 227117

9 years agoUse a different encoding for debugtrap on PS4.
Alex Rosenberg [Mon, 26 Jan 2015 19:09:27 +0000 (19:09 +0000)]
Use a different encoding for debugtrap on PS4.

llvm-svn: 227116

9 years agoFix assert instantiating string init of static variable
Ben Langmuir [Mon, 26 Jan 2015 19:04:10 +0000 (19:04 +0000)]
Fix assert instantiating string init of static variable

... when the variable's type is a typedef of a ConstantArrayType. Just
look through the typedef (and any other sugar).  We only use the
constant array type here to get the element count.

llvm-svn: 227115

9 years agoUpdate for LLVM API change.
Eric Christopher [Mon, 26 Jan 2015 19:03:30 +0000 (19:03 +0000)]
Update for LLVM API change.

llvm-svn: 227114

9 years agoMove DataLayout back to the TargetMachine from TargetSubtargetInfo
Eric Christopher [Mon, 26 Jan 2015 19:03:15 +0000 (19:03 +0000)]
Move DataLayout back to the TargetMachine from TargetSubtargetInfo
derived classes.

Since global data alignment, layout, and mangling is often based on the
DataLayout, move it to the TargetMachine. This ensures that global
data is going to be layed out and mangled consistently if the subtarget
changes on a per function basis. Prior to this all targets(*) have
had subtarget dependent code moved out and onto the TargetMachine.

*One target hasn't been migrated as part of this change: R600. The
R600 port has, as a subtarget feature, the size of pointers and
this affects global data layout. I've currently hacked in a FIXME
to enable progress, but the port needs to be updated to either pass
the 64-bitness to the TargetMachine, or fix the DataLayout to
avoid subtarget dependent features.

llvm-svn: 227113

9 years agoRefine memory dependence's notion of volatile semantics
Philip Reames [Mon, 26 Jan 2015 18:54:27 +0000 (18:54 +0000)]
Refine memory dependence's notion of volatile semantics

According to my reading of the LangRef, volatiles are only ordered with respect to other volatiles. It is entirely legal and profitable to forward unrelated loads over the volatile load. This patch implements this for GVN by refining the transition rules MemoryDependenceAnalysis uses when encountering a volatile.

The added test cases show where the extra flexibility is profitable for local dependence optimizations. I have a related change (227110) which will extend this to non-local dependence (i.e. PRE), but that's essentially orthogonal to the semantic change in this patch. I have tested the two together and can confirm that PRE works over a volatile load with both changes.  I will be submitting a PRE w/volatiles test case seperately in the near future.

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

llvm-svn: 227112

9 years agoModel sqrtsd as a binary operation with one source operand tied to the destination...
Sanjay Patel [Mon, 26 Jan 2015 18:42:16 +0000 (18:42 +0000)]
Model sqrtsd as a binary operation with one source operand tied to the destination (PR14221)

This patch fixes the following miscompile:

define void @sqrtsd(<2 x double> %a) nounwind uwtable ssp {
  %0 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %a) nounwind
  %a0 = extractelement <2 x double> %0, i32 0
  %conv = fptrunc double %a0 to float
  %a1 = extractelement <2 x double> %0, i32 1
  %conv3 = fptrunc double %a1 to float
  tail call void @callee2(float %conv, float %conv3) nounwind
  ret void
}

Current codegen:

sqrtsd %xmm0, %xmm1        ## high element of %xmm1 is undef here
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
shufpd $1, %xmm1, %xmm1
cvtsd2ss %xmm1, %xmm1 ## operating on undef value
jmp _callee

This is a continuation of http://llvm.org/viewvc/llvm-project?view=revision&revision=224624 ( http://reviews.llvm.org/D6330 )
which was itself a continuation of r167064 ( http://llvm.org/viewvc/llvm-project?view=revision&revision=167064 ).

All of these patches are partial fixes for PR14221 ( http://llvm.org/bugs/show_bug.cgi?id=14221 );
this should be the final patch needed to resolve that bug.

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

llvm-svn: 227111

9 years agoPass QueryInst down through non-local dependency calculation
Philip Reames [Mon, 26 Jan 2015 18:39:52 +0000 (18:39 +0000)]
Pass QueryInst down through non-local dependency calculation

This change is mostly motivated by exposing information about the original query instruction to the actual scanning work in getPointerDependencyFrom when used by GVN PRE. In a follow up change, I will use this to be more precise with regards to the semantics of volatile instructions encountered in the scan of a basic block.

Worth noting, is that this change (despite appearing quite simple) is not semantically preserving. By providing more information to the helper routine, we allow some optimizations to kick in that weren't previously able to (when called from this code path.) In particular, we see that treatment of !invariant.load becomes more precise. In theory, we might see a difference with an ordered/atomic instruction as well, but I'm having a hard time actually finding a test case which shows that.

Test wise, I've included new tests for !invariant.load which illustrate this difference. I've also included some updated TBAA tests which highlight that this change isn't needed for that optimization to kick in - it's handled inside alias analysis itself.

Eventually, it would be nice to factor the !invariant.load handling inside alias analysis as well.

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

llvm-svn: 227110

9 years agoRevert GCStrategy ownership changes
Philip Reames [Mon, 26 Jan 2015 18:26:35 +0000 (18:26 +0000)]
Revert GCStrategy ownership changes

This change reverts the interesting parts of 226311 (and 227046).  This change introduced two problems, and I've been convinced that an alternate approach is preferrable anyways.

The bugs were:
- Registery appears to require all users be within the same linkage unit.  After this change, asking for "statepoint-example" in Transform/ would sometimes get you nullptr, whereas asking the same question in CodeGen would return the right GCStrategy.  The correct long term fix is to get rid of the utter hack which is Registry, but I don't have time for that right now.  227046 appears to have been an attempt to fix this, but I don't believe it does so completely.
- GCMetadataPrinter::finishAssembly was being called more than once per GCStrategy.  Each Strategy was being added to the GCModuleInfo multiple times.

Once I get time again, I'm going to split GCModuleInfo into the gc.root specific part and a GCStrategy owning Analysis pass.  I'm probably also going to kill off the Registry.  Once that's done, I'll move the new GCStrategyAnalysis and all built in GCStrategies into Analysis.  (As original suggested by Chandler.)  This will accomplish my original goal of being able to access GCStrategy from Transform/  without adding all of the builtin GCs to IR/.

llvm-svn: 227109

9 years agoTeach raw_ostream to support hex formatting without a prefix '0x'.
Zachary Turner [Mon, 26 Jan 2015 18:21:33 +0000 (18:21 +0000)]
Teach raw_ostream to support hex formatting without a prefix '0x'.

Previously using format_hex() would always print a 0x prior to the
hex characters.  This allows this to be optional, so that one can
choose to print (e.g.) 255 as either 0xFF or just FF.

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

llvm-svn: 227108

9 years agoChange the available features used for no-rtti and no-exceptions
Eric Fiselier [Mon, 26 Jan 2015 18:11:58 +0000 (18:11 +0000)]
Change the available features used for no-rtti and no-exceptions

llvm-svn: 227107

9 years ago[Msan] Disable the ppoll unit test on FreeBSD
Viktor Kutuzov [Mon, 26 Jan 2015 18:05:54 +0000 (18:05 +0000)]
[Msan] Disable the ppoll unit test on FreeBSD
Differential Revision: http://reviews.llvm.org/D7145

llvm-svn: 227106

9 years agoRemove trailing whitespace. NFC ®
Alex Rosenberg [Mon, 26 Jan 2015 18:02:18 +0000 (18:02 +0000)]
Remove trailing whitespace. NFC Â®

llvm-svn: 227105

9 years agoObjective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macros
Fariborz Jahanian [Mon, 26 Jan 2015 17:41:03 +0000 (17:41 +0000)]
Objective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macros
with typed enums. rdar://19352510

llvm-svn: 227104

9 years agoRemove trailing whitespace.
Alex Rosenberg [Mon, 26 Jan 2015 17:35:56 +0000 (17:35 +0000)]
Remove trailing whitespace.

Also test commit email processing by including this char: '®'

llvm-svn: 227103

9 years agoMove the Mips target to storing the ABI in the TargetMachine rather
Eric Christopher [Mon, 26 Jan 2015 17:33:46 +0000 (17:33 +0000)]
Move the Mips target to storing the ABI in the TargetMachine rather
than on MipsSubtargetInfo.

This required a bit of massaging in the MC level to handle this since
MC is a) largely a collection of disparate classes with no hierarchy,
and b) there's no overarching equivalent to the TargetMachine, instead
only the subtarget via MCSubtargetInfo (which is the base class of
TargetSubtargetInfo).

We're now storing the ABI in both the TargetMachine level and in the
MC level because the AsmParser and the TargetStreamer both need to
know what ABI we have to parse assembly and emit objects. The target
streamer has a pointer to the one in the asm parser and is updated
when the asm parser is created. This is fragile as the FIXME comment
notes, but shouldn't be a problem in practice since we always
create an asm parser before attempting to emit object code via the
assembler. The TargetMachine now contains the ABI so that the DataLayout
can be constructed dependent upon ABI.

All testcases have been updated to use the -target-abi command line
flag so that we can set the ABI without using a subtarget feature.

Should be no change visible externally here.

llvm-svn: 227102

9 years agoStore the passed in CPU name string so that it can be accessed later.
Eric Christopher [Mon, 26 Jan 2015 17:33:30 +0000 (17:33 +0000)]
Store the passed in CPU name string so that it can be accessed later.

llvm-svn: 227101

9 years ago[Msan] Fix the statfs unit test to pass on FreeBSD
Viktor Kutuzov [Mon, 26 Jan 2015 17:31:23 +0000 (17:31 +0000)]
[Msan] Fix the statfs unit test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7144

llvm-svn: 227100

9 years agoFix incorrect partial aliasing
Daniel Berlin [Mon, 26 Jan 2015 17:31:17 +0000 (17:31 +0000)]
Fix incorrect partial aliasing
Update testcases

llvm-svn: 227099

9 years agoFix delegation
Daniel Berlin [Mon, 26 Jan 2015 17:30:39 +0000 (17:30 +0000)]
Fix delegation

llvm-svn: 227098

9 years agoFix PR21428. Buffer was one byte too small in octal formatting case. Add test
Marshall Clow [Mon, 26 Jan 2015 17:24:52 +0000 (17:24 +0000)]
Fix PR21428. Buffer was one byte too small in octal formatting case. Add test

llvm-svn: 227097

9 years agoFix darwin-debug build in cmake (OS X)
Zachary Turner [Mon, 26 Jan 2015 17:23:18 +0000 (17:23 +0000)]
Fix darwin-debug build in cmake (OS X)

This patch fixes test_launch_in_terminal test which doesn't work
in OS X since the moment as it was added in r225284. The test fails
because Target::Launch returns the following error: "the darwin-debug
executable doesn't exist at
<output_dir>/lib/python2.7/site-packages/lldb/darwin-debug'".

Patch by Ilia K
Differential Revision: http://reviews.llvm.org/D7102

llvm-svn: 227096

9 years agofix line-endings; NFC
Sanjay Patel [Mon, 26 Jan 2015 17:21:36 +0000 (17:21 +0000)]
fix line-endings; NFC

llvm-svn: 227095

9 years ago[Support][Windows] Disable error dialog boxes when stack trace printing is enabled.
Michael J. Spencer [Mon, 26 Jan 2015 17:05:02 +0000 (17:05 +0000)]
[Support][Windows] Disable error dialog boxes when stack trace printing is enabled.

llvm-svn: 227094

9 years agoPutting all the standard tool options into a "Generic" category.
Chris Bieneman [Mon, 26 Jan 2015 16:56:00 +0000 (16:56 +0000)]
Putting all the standard tool options into a "Generic" category.

Summary:
This puts all the options that CommandLine.cpp implements into a category so that the APIs to hide options can not hide based on the generic category instead of string matching a partial list of argument strings.

This patch is pretty simple and straight forward but it does impact the -help output of all tools using cl::opt. Specifically the options implemented in CommandLine.cpp (help, help-list, help-hidden, help-list-hidden, print-options, print-all-options, version) are all grouped together into an Option category, and these options are never hidden by the cl::HideUnrelatedOptions API.

Reviewers: dexonsmith, chandlerc, majnemer

Subscribers: llvm-commits

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

llvm-svn: 227093

9 years ago[FIX] Debug build + instrinsic handling
Johannes Doerfert [Mon, 26 Jan 2015 15:55:54 +0000 (15:55 +0000)]
[FIX] Debug build + instrinsic handling

  The ignored intrinsics needed to be ignored in three other places as
  well. Tests and lnt pass now.

llvm-svn: 227092

9 years ago[MC] The PS4's ELF OSABI value is the same as FreeBSD.
Alex Rosenberg [Mon, 26 Jan 2015 15:42:07 +0000 (15:42 +0000)]
[MC] The PS4's ELF OSABI value is the same as FreeBSD.

llvm-svn: 227091

9 years agoTeach the autoconf machinery about the PS4 triple.
Alex Rosenberg [Mon, 26 Jan 2015 15:25:05 +0000 (15:25 +0000)]
Teach the autoconf machinery about the PS4 triple.

(I think the last checkin, r227060, got lost from the mailing lists because of the (R) in the comment.)

llvm-svn: 227090

9 years ago[mips] Enable arithmetic and binary operations for the i128 data type.
Vasileios Kalintiris [Mon, 26 Jan 2015 12:33:22 +0000 (12:33 +0000)]
[mips] Enable arithmetic and binary operations for the i128 data type.

Summary:
This patch adds support for some operations that were missing from
128-bit integer types (add/sub/mul/sdiv/udiv... etc.). With these
changes we can support the __int128_t and __uint128_t data types
from C/C++.

Depends on D7125

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 227089

9 years agoFor NetBSD/ARM-EB, link with --be8. Support for the older BE32 is
Joerg Sonnenberger [Mon, 26 Jan 2015 12:30:16 +0000 (12:30 +0000)]
For NetBSD/ARM-EB, link with --be8. Support for the older BE32 is
currently not planned.

llvm-svn: 227088

9 years ago[mips] Add tests for bitwise binary and integer arithmetic operators.
Vasileios Kalintiris [Mon, 26 Jan 2015 12:04:40 +0000 (12:04 +0000)]
[mips] Add tests for bitwise binary and integer arithmetic operators.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 227087

9 years agoAlso except OSError when terminating a child.
Hafiz Abid Qadeer [Mon, 26 Jan 2015 12:03:05 +0000 (12:03 +0000)]
Also except OSError when terminating a child.
Ilia K <ki.stfu@gmail.com> sent this patch. He noted that it was possible for
child to be terminated after isAlive call and before we send it quit command.
In this case, sending command to it causes OSError. This patch just adds this
exception to the except list.

llvm-svn: 227086

9 years agoThe canonical CPU variant for ARM according to config.guess uses a
Joerg Sonnenberger [Mon, 26 Jan 2015 11:41:48 +0000 (11:41 +0000)]
The canonical CPU variant for ARM according to config.guess uses a
suffix it seems:

    # ./config.guess
    earmv7hfeb-unknown-netbsd7.99.4

Extend the triple parsing to support this. Avoid running the ARM parser
multiple times because StringSwitch is not lazy.

Reviewers: Renato Golin, Tim Northover

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

llvm-svn: 227085

9 years agoWhen disassembler meets compact jump instructions for r6 it crashes as the access...
Vladimir Medic [Mon, 26 Jan 2015 10:33:43 +0000 (10:33 +0000)]
When disassembler meets compact jump instructions for r6 it crashes as the access to operands array is out of range. This patch removes dedicated decoder method that wrongly handles decoding of these instructions.

llvm-svn: 227084

9 years agoAdd link to github x86-psABI repo where the ABI doc is being
Jason Molenda [Mon, 26 Jan 2015 10:07:39 +0000 (10:07 +0000)]
Add link to github x86-psABI repo where the ABI doc is being
revised.

llvm-svn: 227083

9 years agoRevert "[mips] Fix assertion on i128 addition/subtraction on MIPS64"
Vasileios Kalintiris [Mon, 26 Jan 2015 09:53:30 +0000 (09:53 +0000)]
Revert "[mips] Fix assertion on i128 addition/subtraction on MIPS64"

This reverts commit r227003. Support for addition/subtraction and
various other operations for the i128 data type will be added in a
future commit based on the review D7143.

llvm-svn: 227082

9 years agopath.data() may return a non null terminated string
Jean-Daniel Dupas [Mon, 26 Jan 2015 09:52:37 +0000 (09:52 +0000)]
path.data() may return a non null terminated string
and raw_fd_ostream constructor expects a StringRef.

llvm-svn: 227081

9 years agoRevert llvm/test/MC/ELF/noexec.s in r227074, "Fix a problem where the AArch64 ELF...
NAKAMURA Takumi [Mon, 26 Jan 2015 09:30:29 +0000 (09:30 +0000)]
Revert llvm/test/MC/ELF/noexec.s in r227074, "Fix a problem where the AArch64 ELF assembler was failing with"

It should be split into target-specific location.

llvm-svn: 227080

9 years ago[X86] Add AVX512 integer comparison intrinsics for word and byte vectors.
Craig Topper [Mon, 26 Jan 2015 09:24:10 +0000 (09:24 +0000)]
[X86] Add AVX512 integer comparison intrinsics for word and byte vectors.

llvm-svn: 227079

9 years ago[msan] Remove MSanDR reference from the manual.
Evgeniy Stepanov [Mon, 26 Jan 2015 09:17:37 +0000 (09:17 +0000)]
[msan] Remove MSanDR reference from the manual.

It is no longer supported.

llvm-svn: 227078

9 years agoSLPVectorizer: fix wrong scheduling of atomic load/stores.
Erik Eckstein [Mon, 26 Jan 2015 09:07:04 +0000 (09:07 +0000)]
SLPVectorizer: fix wrong scheduling of atomic load/stores.

This fixes PR22306.

llvm-svn: 227077

9 years agoCorrect the header guard for MipsABIInfo.h.
Eric Christopher [Mon, 26 Jan 2015 08:19:53 +0000 (08:19 +0000)]
Correct the header guard for MipsABIInfo.h.

llvm-svn: 227076

9 years ago[X86] Add more of the AVX512 integer comparision intrinsics. This adds 128 and 256...
Craig Topper [Mon, 26 Jan 2015 08:11:49 +0000 (08:11 +0000)]
[X86] Add more of the AVX512 integer comparision intrinsics. This adds 128 and 256 bit vectors of dwords and qwords.

llvm-svn: 227075

9 years agoFix a problem where the AArch64 ELF assembler was failing with
Eric Christopher [Mon, 26 Jan 2015 06:32:17 +0000 (06:32 +0000)]
Fix a problem where the AArch64 ELF assembler was failing with
-no-exec-stack. This was due to it not deriving from the correct
asm info base class and missing the override for the exec
stack section query. Added another line to the noexec test
line to make sure this doesn't regress.

llvm-svn: 227074

9 years agoDon't let virtual calls and dynamic casts call Sema::MarkVTableUsed().
Nico Weber [Mon, 26 Jan 2015 06:23:36 +0000 (06:23 +0000)]
Don't let virtual calls and dynamic casts call Sema::MarkVTableUsed().

clang currently calls MarkVTableUsed() for classes that get their virtual
methods called or that participate in a dynamic_cast. This is unnecessary,
since CodeGen only emits vtables when it generates constructor, destructor, and
vtt code. (*)

Note that Sema::MarkVTableUsed() doesn't cause the emission of a vtable.
Its main user-visible effect is that it instantiates virtual member functions
of template classes, to make sure that if codegen decides to write a vtable
all the entries in the vtable are defined.

While this shouldn't change the behavior of codegen (other than being faster),
it does make clang more permissive: virtual methods of templates (in particular
destructors) end up being instantiated less often. In particular, classes that
have members that are smart pointers to incomplete types will now get their
implicit virtual destructor instantiated less frequently. For example, this
used to not compile but does now compile:

    template <typename T> struct OwnPtr {
      ~OwnPtr() { static_assert((sizeof(T) > 0), "TypeMustBeComplete"); }
    };
    class ScriptLoader;
    struct Base { virtual ~Base(); };
    struct Sub : public Base {
      virtual void someFun() const {}
      OwnPtr<ScriptLoader> m_loader;
    };
    void f(Sub *s) { s->someFun(); }

The more permissive behavior matches both gcc (where this is not often
observable, since in practice most things with virtual methods have a key
function, and Sema::DefineUsedVTables() skips vtables for classes with key
functions) and cl (which is my motivation for this change) â€“ this fixes
PR20337.  See this issue and the review thread for some discussions about
optimizations.

This is similar to r213109 in spirit. r225761 was a prerequisite for this
change.

Various tests relied on "a->f()" marking a's vtable as used (in the sema
sense), switch these to just construct a on the stack. This forces
instantiation of the implicit constructor, which will mark the vtable as used.

(*) The exception is -fapple-kext mode: In this mode, qualified calls to
virtual functions (`a->Base::f()`) still go through the vtable, and since the
vtable pointer off this doesn't point to Base's vtable, this needs to reference
Base's vtable directly. To keep this working, keep referencing the vtable for
virtual calls in apple kext mode.

llvm-svn: 227073

9 years agoTest that member functions of constexpr constructed templates are instantiated.
Nico Weber [Mon, 26 Jan 2015 06:08:07 +0000 (06:08 +0000)]
Test that member functions of constexpr constructed templates are instantiated.

They are referenced from the vtable. (This worked fine, but I couldn't find
an existing test for this.  Maybe I didn't look hard enough.)

llvm-svn: 227072

9 years agoRemove -verify from a codegen test that didn't have any expected-foo lines.
Nico Weber [Mon, 26 Jan 2015 05:47:24 +0000 (05:47 +0000)]
Remove -verify from a codegen test that didn't have any expected-foo lines.

Makes the error output of the test more readable when it fails. Also allows
removing a "not" from the run line.

llvm-svn: 227071

9 years agoclang-format two Decl* code locations, NFC.
Yaron Keren [Mon, 26 Jan 2015 04:41:07 +0000 (04:41 +0000)]
clang-format two Decl* code locations, NFC.

llvm-svn: 227070

9 years agoReword comment.
Nico Weber [Mon, 26 Jan 2015 03:03:49 +0000 (03:03 +0000)]
Reword comment.

llvm-svn: 227069

9 years agoTest that qualified virtual calls mark vtables referenced in apple kext mode.
Nico Weber [Mon, 26 Jan 2015 02:59:07 +0000 (02:59 +0000)]
Test that qualified virtual calls mark vtables referenced in apple kext mode.

I broke this locally while working on PR20337 and no test caught that.  Now
there's coverage for this, and a comment explaining why this is needed.

llvm-svn: 227068

9 years ago[X86] Add AVX512F integer comparision intrinsics to header file.
Craig Topper [Sun, 25 Jan 2015 23:30:07 +0000 (23:30 +0000)]
[X86] Add AVX512F integer comparision intrinsics to header file.

llvm-svn: 227067

9 years ago[X86] Add immediate range checking to AVX512 integer comparision builtins.
Craig Topper [Sun, 25 Jan 2015 23:30:05 +0000 (23:30 +0000)]
[X86] Add immediate range checking to AVX512 integer comparision builtins.

llvm-svn: 227066

9 years ago[X86] Add AVX512 floating cmpgt and integer comparison builtins. Intrinsic header...
Craig Topper [Sun, 25 Jan 2015 23:30:00 +0000 (23:30 +0000)]
[X86] Add AVX512 floating cmpgt and integer comparison builtins. Intrinsic header file usages coming later.

llvm-svn: 227065

9 years ago[X86] Change comparision immediate type to i8 in test cases for AVX512 floating point...
Craig Topper [Sun, 25 Jan 2015 23:26:12 +0000 (23:26 +0000)]
[X86] Change comparision immediate type to i8 in test cases for AVX512 floating point comparisons. The type was already changed in the definitions and was being auto upgraded to the new type.

llvm-svn: 227064

9 years ago[X86] Use i8 immediate for comparison type on AVX512 packed integer instructions...
Craig Topper [Sun, 25 Jan 2015 23:26:02 +0000 (23:26 +0000)]
[X86] Use i8 immediate for comparison type on AVX512 packed integer instructions. This matches floating point equivalents. Includes autoupgrade support to convert old code.

llvm-svn: 227063

9 years agoAllows Clang to use LLVM's fixes-x18 option
Renato Golin [Sun, 25 Jan 2015 23:17:48 +0000 (23:17 +0000)]
Allows Clang to use LLVM's fixes-x18 option

This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.

This uses llvm r226664 to allow this register to be reserved.

Patch by Andrew Turner.

llvm-svn: 227062

9 years agoclang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.
NAKAMURA Takumi [Sun, 25 Jan 2015 23:10:21 +0000 (23:10 +0000)]
clang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.

llvm-svn: 227061

9 years agoAdd the triple for the Sony Playstation®4.
Alex Rosenberg [Sun, 25 Jan 2015 22:46:59 +0000 (22:46 +0000)]
Add the triple for the Sony Playstation®4.

Lots more to follow.

llvm-svn: 227060

9 years ago[Mips] Add checking of disassembler output in some test cases
Simon Atanasyan [Sun, 25 Jan 2015 21:31:52 +0000 (21:31 +0000)]
[Mips] Add checking of disassembler output in some test cases

No functional changes.

llvm-svn: 227059

9 years ago[Mips] Teach LLD to recognize one more MIPS target triple - mips64el
Simon Atanasyan [Sun, 25 Jan 2015 19:15:35 +0000 (19:15 +0000)]
[Mips] Teach LLD to recognize one more MIPS target triple - mips64el

This is initial patch to support MIPS64 object files linking.
The patch just makes some classes more generalized, and rejects
attempts to interlinking O32 and N64 ABI object files.

I try to reuse the current MIPS target related classes as much as
possible because O32 and N64 MIPS ABI are tightly related and share
almost the same set of relocations, GOT, flags etc.

llvm-svn: 227058

9 years ago[FIX] Independent blocks with intrinsics handling
Johannes Doerfert [Sun, 25 Jan 2015 19:09:49 +0000 (19:09 +0000)]
[FIX] Independent blocks with intrinsics handling

  Also an old option was removed from some new test cases

llvm-svn: 227057

9 years agoDebug info: Fix PR22296 by omitting the DW_AT_location if we lost the
Adrian Prantl [Sun, 25 Jan 2015 19:04:08 +0000 (19:04 +0000)]
Debug info: Fix PR22296 by omitting the DW_AT_location if we lost the
physical register that is described in a DBG_VALUE.

In the testcase the DBG_VALUE describing "p5" becomes unavailable
because the register its address is in is clobbered and we (currently)
aren't smart enough to realize that the value is rematerialized immediately
after the DBG_VALUE and/or is actually a stack slot.

llvm-svn: 227056

9 years ago[PowerPC] Revert ppc64le-aggregates.ll test changes from r227053
Bill Schmidt [Sun, 25 Jan 2015 18:18:54 +0000 (18:18 +0000)]
[PowerPC] Revert ppc64le-aggregates.ll test changes from r227053

It appears we have different behavior with and without -mcpu=pwr8 even
with ppc64le defaulting to POWER8.  The failure appears as follows:

/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/test/CodeGen/PowerPC/ppc64le-aggregates.ll:268:14: error: expected string not found in input
; CHECK-DAG: lfs 1, 0([[REG]])
             ^
<stdin>:497:11: note: scanning from here
 ld 3, .LC1@toc@l(3)
          ^
<stdin>:497:11: note: with variable "REG" equal to "3"
 ld 3, .LC1@toc@l(3)
          ^
<stdin>:514:2: note: possible intended match here
 lfs 1, 0(4)
 ^

Reverting this particular test case change.  Nemanja, please have a look
at the reason for the failure.

llvm-svn: 227055

9 years agoSupport for math/misc intrinsics
Johannes Doerfert [Sun, 25 Jan 2015 18:07:30 +0000 (18:07 +0000)]
Support for math/misc intrinsics

  The support is currently limited as we only allow them in the input but do
  not emit them in the transformed SCoP due to the possible semantic changes.

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

llvm-svn: 227054

9 years ago[PowerPC] Reset the baseline for ppc64le to be equivalent to pwr8
Bill Schmidt [Sun, 25 Jan 2015 18:05:42 +0000 (18:05 +0000)]
[PowerPC] Reset the baseline for ppc64le to be equivalent to pwr8

Test by Nemanja Ivanovic.

Since ppc64le implies POWER8 as a minimum, it makes sense that the
same features are included. Since the pwr8 processor model will likely
be getting new features until the implementation is complete, I
created a new list to add these updates to. This will include them in
both pwr8 and ppc64le.

Furthermore, it seems that it would make sense to compose the feature
lists for other processor models (pwr3 and up). Per discussion in the
review, I will make this change in a subsequent patch.

In order to test the changes, I've added an additional run step to
test cases that specify -march=ppc64le -mcpu=pwr8 to omit the -mcpu
option. Since the feature lists are the same, the behaviour should be
unchanged.

llvm-svn: 227053

9 years agoSema: Formatting. No behavior change.
Francisco Lopes da Silva [Sun, 25 Jan 2015 17:00:47 +0000 (17:00 +0000)]
Sema: Formatting. No behavior change.

llvm-svn: 227052

9 years ago[Mips] Make MipsELFObjectReader and MipsELFDSOReader class templates
Simon Atanasyan [Sun, 25 Jan 2015 16:38:16 +0000 (16:38 +0000)]
[Mips] Make MipsELFObjectReader and MipsELFDSOReader class templates

No functional changes.

llvm-svn: 227051