Zachary Turner [Wed, 9 Jul 2014 16:42:27 +0000 (16:42 +0000)]
Dont' use a random probe & alloc strategy for the IRMemoryMap.
The current strategy for host allocation is to choose a random
address and attempt to allocate there, eventually failing if the
allocation cannot be satisfied.
The C standard only guarantees that RAND_MAX >= 32767, so for
platforms that use a very small RAND_MAX allocations will fail
with very high probability. On such platforms (Windows is one),
you can reproduce this trivially by running lldb, typing "expr (3)"
and then hitting enter you see a failure. Failures generally
happen with a frequency of about 1 failure every 5 evaluations.
There is no good reason that allocations need to look like "real"
pointers, so this patch changes the allocation scheme to simply
jump straight to the end and grab a free chunk of memory.
Reviewed By: Sean Callanan
Differential Revision: http://reviews.llvm.org/D4300
llvm-svn: 212630
Sanjay Patel [Wed, 9 Jul 2014 16:34:54 +0000 (16:34 +0000)]
Fix for PR20059 (instcombine reorders shufflevector after instruction that may trap)
In PR20059 ( http://llvm.org/pr20059 ), instcombine eliminates shuffles that are necessary before performing an operation that can trap (srem).
This patch calls isSafeToSpeculativelyExecute() and bails out of the optimization in SimplifyVectorOp() if needed.
Differential Revision: http://reviews.llvm.org/D4424
llvm-svn: 212629
Zachary Turner [Wed, 9 Jul 2014 16:32:07 +0000 (16:32 +0000)]
Fix tests broken by the OptionValidator changes.
The getopt library has a structure called option (lowercase). We
have a structure called Option (uppercase). previously the two
structures had exactly the same definitions, and we were doing a
C-style cast of an Option* to an option*. C-style casts don't
bother to warn you when you cast to unrelated types, but in the
original OptionValidator patch I modified the definition of Option.
This patch fixes the errors by building an array of option
structures and filling it out the correct way before passing it to
the getopt library.
This also fixes one other source of test failures: an uninitialized
read that occurs due to not initializing a field of the
OptionDefinition.
Reviewed By: Todd Fiala
Differential Revision: http://reviews.llvm.org/D4425
llvm-svn: 212628
Zachary Turner [Wed, 9 Jul 2014 16:31:49 +0000 (16:31 +0000)]
Revert "Fix broken tests due to new error output."
This reverts commit
ec7c94f8e6860968d384b578e5564a9c55c80b4a and
re-enables OptionValidators.
llvm-svn: 212627
Daniel Sanders [Wed, 9 Jul 2014 16:03:10 +0000 (16:03 +0000)]
Add Imagination Technologies to the vendors in llvm::Triple
Summary: This is a pre-requisite for supporting the mips-img-linux-gnu triple in clang.
Differential Revision: http://reviews.llvm.org/D4435
llvm-svn: 212626
Daniel Sanders [Wed, 9 Jul 2014 14:21:18 +0000 (14:21 +0000)]
[mips][mips64r6] Implement -mips32r6 and -mips64r6 aliases to -march=mips32r6 and -march=mips64r6
Differential Revision: http://reviews.llvm.org/D4434
llvm-svn: 212625
Alp Toker [Wed, 9 Jul 2014 14:12:55 +0000 (14:12 +0000)]
Prospective legacy build system fix following r212620
llvm-svn: 212624
Alp Toker [Wed, 9 Jul 2014 14:09:52 +0000 (14:09 +0000)]
Remove dead code from r212620
llvm-svn: 212622
Alp Toker [Wed, 9 Jul 2014 14:06:35 +0000 (14:06 +0000)]
Fix 'source-level' hyphenations
llvm-svn: 212621
Alp Toker [Wed, 9 Jul 2014 14:05:11 +0000 (14:05 +0000)]
cc1as: consolidate option flags with cc1 and eliminate duplication
The clang -cc1as options are nearly a strict subset of -cc1. Instead of
duplicating the definitions and documentation, let's go ahead and share the
definitions in a similar way the current handling of combined driver and
frontend flags, eliminating some of the vestigial legacy surrounding the
assembler subcommand.
llvm-svn: 212620
Daniel Sanders [Wed, 9 Jul 2014 13:56:23 +0000 (13:56 +0000)]
[mips][mips64r6] Define _MIPS_FPSET, __mips_fpr, and __mips_nan2008 correctly on MIPS32r6/MIPS64r6
Summary:
This removes the need to pass -mnan=2008 explicitly to be able to compile
the test-suite for MIPS32r6/MIPS64r6.
Differential Revision: http://reviews.llvm.org/D4433
llvm-svn: 212619
Daniel Sanders [Wed, 9 Jul 2014 13:43:19 +0000 (13:43 +0000)]
[mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.
Summary:
While debugging another issue, I noticed that Mips currently specifies that the
count leading zero builtins are undefined when the input is zero. The
architecture specifications say that the clz and dclz instructions write 32 or
64 respectively when given zero.
This doesn't fix any bugs that I'm aware of but it may improve optimisation in
some cases.
Differential Revision: http://reviews.llvm.org/D4431
llvm-svn: 212618
Daniel Jasper [Wed, 9 Jul 2014 13:07:57 +0000 (13:07 +0000)]
clang-format: Fix behavior around pointer-to-member invocations.
Before:
(
aaaaaaaaaa->*
bbbbbbb)(
aaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaa));
After:
(
aaaaaaaaaa->*bbbbbbb)(
aaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaa));
llvm-svn: 212617
Tim Northover [Wed, 9 Jul 2014 13:03:54 +0000 (13:03 +0000)]
[all]: Use range-based ArgList adapter instead of filtered_begin/filtered_end
Some of those loops were pretty monstrous.
llvm-svn: 212616
Tim Northover [Wed, 9 Jul 2014 13:03:37 +0000 (13:03 +0000)]
Generic: add range-adapter for option parsing.
I want to use it in lld, but while I'm here I'll update LLVM uses.
llvm-svn: 212615
Chandler Carruth [Wed, 9 Jul 2014 12:36:54 +0000 (12:36 +0000)]
[x86] Fix a bug in my new zext-vector-inreg DAG trickery where we were
not widening the input type to the node sufficiently to let the ext take
place in a register.
This would in turn result in a mysterious bitcast assertion failure
downstream. First change here is to add back the helpful assert I had in
an earlier version of the code to catch this immediately.
Next change is to add support to the type legalization to detect when we
have widened the operand either too little or too much (for whatever
reason) and find a size-matched legal vector type to convert it to
first. This can also fail so we get a new fallback path, but that seems
OK.
With this, we no longer crash on vec_cast2.ll when using widening. I've
also added the CHECK lines for the zero-extend cases here. We still need
to support sign-extend and trunc (or something) to get plausible code
for the other two thirds of this test which is one of the regression
tests that showed the most scalarization when widening was
force-enabled. Slowly closing in on widening being a viable legalization
strategy without it resorting to scalarization at every turn. =]
llvm-svn: 212614
Simon Atanasyan [Wed, 9 Jul 2014 12:31:11 +0000 (12:31 +0000)]
[Mips] Make rel-dynamic-08.test test case independent from external input files.
llvm-svn: 212613
Chandler Carruth [Wed, 9 Jul 2014 11:13:16 +0000 (11:13 +0000)]
Sink two variables only used in an assert into the assert itself. Should
fix the release builds with Werror.
llvm-svn: 212612
Benjamin Kramer [Wed, 9 Jul 2014 11:12:39 +0000 (11:12 +0000)]
X86: When lowering v8i32 himuls use the correct shuffle masks for AVX2.
Turns out my trick of using the same masks for SSE4.1 and AVX2 didn't work out
as we have to blend two vectors. While there remove unecessary cross-lane moves
from the shuffles so the backend can lower it to palignr instead of vperm.
Fixes PR20118, a miscompilation of vector sdiv by constant on AVX2.
llvm-svn: 212611
Chandler Carruth [Wed, 9 Jul 2014 10:58:18 +0000 (10:58 +0000)]
[x86] Add a ZERO_EXTEND_VECTOR_INREG DAG node and use it when widening
vector types to be legal and a ZERO_EXTEND node is encountered.
When we use widening to legalize vector types, extend nodes are a real
challenge. Either the input or output is likely to be legal, but in many
cases not both. As a consequence, we don't really have any way to
represent this situation and the prior code in the widening legalization
framework would just scalarize the extend operation completely.
This patch introduces a new DAG node to represent doing a zero extend of
a vector "in register". The core of the idea is to allow legal but
different vector types in the input and output. The output vector must
have fewer lanes but wider elements. The operation is defined to zero
extend the low elements of the input to the size of the output elements,
and drop all of the high elements which don't have a corresponding lane
in the output vector.
It also includes generic expansion of this node in terms of blending
a zero vector into the high elements of the vector and bitcasting
across. This in turn yields extremely nice code for x86 SSE2 when we use
the new widening legalization logic in conjunction with the new shuffle
lowering logic.
There is still more to do here. We need to support sign extension, any
extension, and potentially int-to-float conversions. My current plan is
to continue using similar synthetic nodes to model each of these
transitions with generic lowering code for each one.
However, with this patch LLVM already reaches performance parity with
GCC for the core C loops of the x264 code (assuming you disable the
hand-written assembly versions) when compiling for SSE2 and SSE3
architectures and enabling the new widening and lowering logic for
vectors.
Differential Revision: http://reviews.llvm.org/D4405
llvm-svn: 212610
Tobias Grosser [Wed, 9 Jul 2014 10:50:10 +0000 (10:50 +0000)]
clang-format polly to avoid buildbot noise
llvm-svn: 212609
Daniel Sanders [Wed, 9 Jul 2014 10:47:26 +0000 (10:47 +0000)]
[mips][mips64r6] Correct select patterns that have the condition or true/false values backwards
Summary: This bug caused SingleSource/Regression/C/uint64_to_float and SingleSource/UnitTests/2002-05-02-CastTest3 to fail (among others).
Differential Revision: http://reviews.llvm.org/D4388
llvm-svn: 212608
Daniel Sanders [Wed, 9 Jul 2014 10:40:20 +0000 (10:40 +0000)]
[mips][mips64r6] Correct cond names in the cmp.cond.[ds] instructions
Summary:
It seems we accidentally read the wrong column of the table MIPS64r6 spec
and used the names for c.cond.fmt instead of cmp.cond.fmt.
Differential Revision: http://reviews.llvm.org/D4387
llvm-svn: 212607
Chandler Carruth [Wed, 9 Jul 2014 10:36:42 +0000 (10:36 +0000)]
[x86] Initialize a pointer to null to fix a bug in r212602.
This should restore GCC hosts (which happen to put the bad stuff into
the pointer) and MSan, etc.
llvm-svn: 212606
Daniel Sanders [Wed, 9 Jul 2014 10:21:59 +0000 (10:21 +0000)]
[mips][mips64r6] Use JALR for indirect branches instead of JR (which is not available on MIPS32r6/MIPS64r6)
Summary:
This completes the change to use JALR instead of JR on MIPS32r6/MIPS64r6.
Reviewers: jkolek, vmedic, zoran.jovanovic, dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4269
llvm-svn: 212605
Daniel Sanders [Wed, 9 Jul 2014 10:16:07 +0000 (10:16 +0000)]
[mips][mips64r6] Use JALR for returns instead of JR (which is not available on MIPS32r6/MIPS64r6)
Summary:
RET, and RET_MM have been replaced by a pseudo named PseudoReturn.
In addition a version with a 64-bit GPR named PseudoReturn64 has been
added.
Instruction selection for a return matches RetRA, which is expanded post
register allocation to PseudoReturn/PseudoReturn64. During MipsAsmPrinter,
this PseudoReturn/PseudoReturn64 are emitted as:
- (JALR64 $zero, $rs) on MIPS64r6
- (JALR $zero, $rs) on MIPS32r6
- (JR_MM $rs) on microMIPS
- (JR $rs) otherwise
On MIPS32r6/MIPS64r6, 'jr $rs' is an alias for 'jalr $zero, $rs'. To aid
development and review (specifically, to ensure all cases of jr are
updated), these aliases are temporarily named 'r6.jr' instead of 'jr'.
A follow up patch will change them back to the correct mnemonic.
Added (JALR $zero, $rs) to MipsNaClELFStreamer's definition of an indirect
jump, and removed it from its definition of a call.
Note: I haven't accounted for MIPS64 in MipsNaClELFStreamer since it's
doesn't appear to account for any MIPS64-specifics.
The return instruction created as part of eh_return expansion is now expanded
using expandRetRA() so we use the right return instruction on MIPS32r6/MIPS64r6
('jalr $zero, $rs').
Also, fixed a misuse of isABI_N64() to detect 64-bit wide registers in
expandEhReturn().
Reviewers: jkolek, vmedic, mseaborn, zoran.jovanovic, dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4268
llvm-svn: 212604
Daniel Sanders [Wed, 9 Jul 2014 10:07:36 +0000 (10:07 +0000)]
Add ability to emit internal instruction representation to CodeGen assembly output.
Summary:
This patch re-uses the implementation of 'llvm-mc -show-inst' and makes it
available to llc as 'llc -asm-show-inst'.
This is necessary to test parts of MIPS32r6/MIPS64r6 without resorting to
'llc -filetype=obj' tests. For example, on MIPS32r2 and earlier we use the
'jr $rs' instruction for indirect branches and returns. On MIPS32r6, we no
longer have 'jr $rs' and use 'jalr $zero, $rs' instead. The catch is that,
on MIPS32r6, 'jr $rs' is an alias for 'jalr $zero, $rs' and is the preferred
way of writing this instruction. As a result, all MIPS ISA's emit 'jr $rs' in
their assembly output and the assembler encodes this to different opcodes
according to the ISA.
Using this option, we can check that the MCInst really is a JR or a JALR by
matching the emitted comment. This removes the need for a 'llc -filetype=obj'
test.
Reviewers: rafael, dsanders
Reviewed By: dsanders
Subscribers: zoran.jovanovic, llvm-commits
Differential Revision: http://reviews.llvm.org/D4267
llvm-svn: 212603
Chandler Carruth [Wed, 9 Jul 2014 10:06:58 +0000 (10:06 +0000)]
[x86] Re-apply a variant of the x86 side of r212324 now that the rest
has settled without incident, removing the x86-specific and overly
strict 'isVectorSplat' routine in favor of generic and more powerful
splat detection.
The primary motivation and result of this is that the x86 backend can
now see through splats which contain undef elements. This is essential
if we are using a widening form of legalization and I've updated a test
case to also run in that mode as before this change the generated code
for the test case was completely scalarized.
This version of the patch much more carefully handles the undef lanes.
- We aren't overly conservative about them in the shift lowering
(where we will never use the splat itself).
- One place where the splat would have been re-used by the existing code
now explicitly constructs a new constant splat that will be safe.
- The broadcast lowering is much more reasonable with undefs by doing
a correct check of whether the splat is the only user of a loaded
value, checking that the splat actually crosses multiple lanes before
using a broadcast, and handling broadcasts of non-constant splats.
As a consequence of the last bullet, the weird usage of vpshufd instead
of vbroadcast is gone, and we actually can lower an AVX splat with
vbroadcastss where before we emitted a really strange pattern of
a vector load and a manual splat across the vector.
llvm-svn: 212602
Alexey Bataev [Wed, 9 Jul 2014 10:00:31 +0000 (10:00 +0000)]
Fixed incompatibility with MSVC builds in range-based for loops in DataRecursiveASTVisitor and RecursiveASTVisitor for OpenMP constructs.
llvm-svn: 212601
Alexey Bataev [Wed, 9 Jul 2014 09:50:46 +0000 (09:50 +0000)]
Revert commit 212599.
llvm-svn: 212600
Alexey Bataev [Wed, 9 Jul 2014 09:33:29 +0000 (09:33 +0000)]
[OPENMP] Fixed incompatibility in [Data]RecursiveASTVisitor::TraverseOMPExecutableDirective method with MSVC for range-based loops.
llvm-svn: 212599
Tim Northover [Wed, 9 Jul 2014 09:24:43 +0000 (09:24 +0000)]
ARM: use LLVM's atomicrmw instructions when ldrex/strex are available.
Having some kind of weird kernel-assisted ABI for these when the
native instructions are available appears to be (and should be) the
exception; OSs have been gradually opting in for years and the code
was getting silly.
So let LLVM decide whether it's possible/profitable to inline them by
default.
Patch by Phoebe Buckheister.
llvm-svn: 212598
Daniel Jasper [Wed, 9 Jul 2014 08:42:42 +0000 (08:42 +0000)]
clang-format: Add new option to indent wrapped function declarations.
Though not completely identical, make former
IndentFunctionDeclarationAfterType change this flag for backwards
compatibility (it is somewhat close in meaning and better the err'ing on
an unknown config flag).
llvm-svn: 212597
Timur Iskhodzhanov [Wed, 9 Jul 2014 08:35:33 +0000 (08:35 +0000)]
[ASan/Win] Don't instrument COMDAT globals. Properly fixes PR20244.
llvm-svn: 212596
Dmitri Gribenko [Wed, 9 Jul 2014 08:30:15 +0000 (08:30 +0000)]
SourceMgr: consistently use 'unsigned' for the memory buffer ID type
llvm-svn: 212595
Daniel Jasper [Wed, 9 Jul 2014 08:19:11 +0000 (08:19 +0000)]
clang-format: Update flag documentation.
llvm-svn: 212594
Daniel Jasper [Wed, 9 Jul 2014 08:18:31 +0000 (08:18 +0000)]
Delete removed formatting option.
llvm-svn: 212593
Alexey Bataev [Wed, 9 Jul 2014 08:00:46 +0000 (08:00 +0000)]
[OPENMP] Improved code of DataRecursiveASTVisitor and RecursiveASTVisitor for OpenMP constructs per Tobias Grosser comments.
llvm-svn: 212592
Daniel Jasper [Wed, 9 Jul 2014 07:50:33 +0000 (07:50 +0000)]
clang-format: Revamp function declaration/definition indentation.
Key changes:
- Correctly (well ...) distinguish function declarations and variable
declarations with ()-initialization.
- Don't indent when breaking function declarations/definitions after the
return type.
- Indent variable declarations and typedefs when breaking after the
type.
This fixes llvm.org/PR17999.
llvm-svn: 212591
Alp Toker [Wed, 9 Jul 2014 06:27:05 +0000 (06:27 +0000)]
Prospective -fsanitize=memory build fix following r212586
This -f group flag appears to influence linker flags, breaking the usual rules
and causing CMake's link invocation to fail during feature detection due to
missing link dependencies (msan_*).
Let's forcibly add it for now to get things the way they were before feature
detection started working.
llvm-svn: 212590
Nikola Smiljanic [Wed, 9 Jul 2014 05:42:35 +0000 (05:42 +0000)]
Fix typos.
llvm-svn: 212589
Nikola Smiljanic [Wed, 9 Jul 2014 05:34:24 +0000 (05:34 +0000)]
Use correct memeber when displaying StringMap's size.
llvm-svn: 212588
Alp Toker [Wed, 9 Jul 2014 03:39:32 +0000 (03:39 +0000)]
CMake: make __DATE__, __TIME__ etc. macro usage an error
When LLVM_ENABLE_TIMESTAMPS has been disabled we can prevent the preprocessor
from embedding dates, times and file timestamps.
There are a few motivations for this:
1) Validate the recent CMake feature detection bugfix from LLVM r212586 with
a flag that's not actually available everywhere.
2) Dogfood clang's new -Wdate-time warning from r210511 when bootstrapping.
3) Encourage reproducible builds.
llvm-svn: 212587
Alp Toker [Wed, 9 Jul 2014 03:38:19 +0000 (03:38 +0000)]
CMake: fix compiler feature detection
add_flag_if_supported() and add_flag_or_print_warning() were effectively
no-ops, just returning the value of the first result (usually
'-fno-omit-frame-pointer') for all subsequent checks for different flags.
Due to the way CMake caches feature detection results, we need to provide
symbolic variable names which will persist the cached results. This commit
fixes feature detection using these two macros.
The feature checks now run and get stored correctly, and the correct output can
be observed in configure logs:
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
llvm-svn: 212586
Alp Toker [Wed, 9 Jul 2014 01:37:36 +0000 (01:37 +0000)]
clang-interpreter: don't check input file existence, we're in-process
This flag is set by most other tools and avoids extra stat() calls. The
frontend will diagnose anyway as it performs the check atomically while opening
files at point of use.
We could probably make Driver::CheckInputsExist default to false and only
enable it in the main 'clang' binary, or even better only perform the checks if
we know the tool is external but that needs more thought.
llvm-svn: 212585
Alp Toker [Wed, 9 Jul 2014 01:37:24 +0000 (01:37 +0000)]
Simplify warning flag value handling from r206826
Also give the field it a more appropriate name and improve the docs.
llvm-svn: 212584
Todd Fiala [Wed, 9 Jul 2014 01:29:05 +0000 (01:29 +0000)]
__arm64__ and __aarch64__ #ifdef adjustments
Change by Paul Osmialowski
See http://reviews.llvm.org/D4379 for details.
llvm-svn: 212583
Jason Molenda [Wed, 9 Jul 2014 01:10:37 +0000 (01:10 +0000)]
Correct indentation level for one line.
llvm-svn: 212582
Chandler Carruth [Wed, 9 Jul 2014 00:41:34 +0000 (00:41 +0000)]
[SDAG] At the suggestion of Hal, switch to an output parameter that
tracks which elements of the build vector are in fact undef.
This should make actually inpsecting them (likely in my next patch)
reasonably pretty. Also makes the output parameter optional as it is
clear now that *most* users are happy with undefs in their splats.
llvm-svn: 212581
Ehsan Akhgari [Wed, 9 Jul 2014 00:40:50 +0000 (00:40 +0000)]
[ms-coff] Add a test for proper handling of full Windows path names in the .drectve section
Summary: This test ensures that we can correctly specify a full Windows path to the clang ASAN runtime libraries. This is in preparation to fix PR20246.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4427
llvm-svn: 212580
Nick Kledzik [Wed, 9 Jul 2014 00:25:52 +0000 (00:25 +0000)]
Change llvm-nm to use -M instead of -s to work with latest llvm-nm
llvm-svn: 212579
Nico Weber [Tue, 8 Jul 2014 23:54:25 +0000 (23:54 +0000)]
rewrap to 80 cols, no behavior change
llvm-svn: 212578
NAKAMURA Takumi [Tue, 8 Jul 2014 23:48:22 +0000 (23:48 +0000)]
MipsTargetStreamer.h: Avoid "using" to appease msc17.
llvm-svn: 212577
Kevin Enderby [Tue, 8 Jul 2014 23:47:31 +0000 (23:47 +0000)]
Changed the lvm-nm alias "-s" for -print-armap to "-M".
This will allow the "-s" flag to implemented in the future as it
is in darwin’s nm(1) to list symbols only in the specified section.
Given a LGTM by Shankar Easwaran who originally implemented
the support for lvm-nm’s -print-armap and archive map symbols.
llvm-svn: 212576
Jason Molenda [Tue, 8 Jul 2014 23:46:39 +0000 (23:46 +0000)]
Tweak for lldb coding style consistency.
llvm-svn: 212575
Nico Weber [Tue, 8 Jul 2014 23:46:20 +0000 (23:46 +0000)]
rewrap to 80 cols, no behavior change
llvm-svn: 212574
Jim Grosbach [Tue, 8 Jul 2014 23:28:48 +0000 (23:28 +0000)]
AArch64: Better codegen for loading from __fp16.
Loading will generally extend to an f32 or an 64, so make sure
to match those patterns directly to load into the FPR16 register
class directly rather than going through the integer GPRs.
This also eliminates an extra step in the convert-to-f64 path
which was first converting to f32 and then to f64 from there.
rdar://
17594379
llvm-svn: 212573
Hal Finkel [Tue, 8 Jul 2014 23:16:49 +0000 (23:16 +0000)]
Improve BasicAA CS-CS queries
BasicAA contains knowledge of certain intrinsics, such as memcpy and memset,
and uses that information to form more-accurate answers to CallSite vs. Loc
ModRef queries. Unfortunately, it did not use this information when answering
CallSite vs. CallSite queries.
Generically, when an intrinsic takes one or more pointers and the intrinsic is
marked only to read/write from its arguments, the offset/size is unknown. As a
result, the generic code that answers CallSite vs. CallSite (and CallSite vs.
Loc) queries in AA uses UnknownSize when forming Locs from an intrinsic's
arguments. While BasicAA's CallSite vs. Loc override could use more-accurate
size information for some intrinsics, it did not do the same for CallSite vs.
CallSite queries.
This change refactors the intrinsic-specific logic in BasicAA into a generic AA
query function: getArgLocation, which is overridden by BasicAA to supply the
intrinsic-specific knowledge, and used by AA's generic implementation. This
allows the intrinsic-specific knowledge to be used by both CallSite vs. Loc and
CallSite vs. CallSite queries, and simplifies the BasicAA implementation.
Currently, only one function, Mac's memset_pattern16, is handled by BasicAA
(all the rest are intrinsics). As a side-effect of this refactoring, BasicAA's
getModRefBehavior override now also returns OnlyAccessesArgumentPointees for
this function (which is an improvement).
llvm-svn: 212572
Rui Ueyama [Tue, 8 Jul 2014 23:11:01 +0000 (23:11 +0000)]
[PECOFF] Fix .bss section alignment
Previously the alignment of the .bss section was not
properly set because of a bug in AtomizeDefinedSymbolsInSection.
We set the alignment of the section at the end of the function,
but we use an eraly return for the .bss section, so the code had
been skipped.
llvm-svn: 212571
Tobias Grosser [Tue, 8 Jul 2014 22:51:03 +0000 (22:51 +0000)]
DominanceInfo is strongly preferred over RegionInfo
This is and always was strong community consensus. Make this clear in the header
in case newcomers may not be aware.
llvm-svn: 212570
Marshall Clow [Tue, 8 Jul 2014 22:38:11 +0000 (22:38 +0000)]
string_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live.
llvm-svn: 212569
Kevin Enderby [Tue, 8 Jul 2014 22:10:02 +0000 (22:10 +0000)]
Add support for BSD format Archive map symbols (aka the table of contents
from a __.SYMDEF or "__.SYMDEF SORTED" archive member).
llvm-svn: 212568
Greg Clayton [Tue, 8 Jul 2014 21:45:21 +0000 (21:45 +0000)]
Make sure that qProcessInfo packet returns correct cpu type/subtype for processes on Haswell machines with a Haswell enabled kernel.
<rdar://problem/
17332107>
llvm-svn: 212567
Reid Kleckner [Tue, 8 Jul 2014 21:35:03 +0000 (21:35 +0000)]
MS compat: Allow lookup of types from dependent bases in functions
If we want to resolve the remaining FIXMEs here, we probably want to
extend the main lookup mechanism to perform lookup into dependent bases,
but we would have to tread lightly. Adding more name lookup has major
impact on compile time.
If we did extend the main mechanism, we would add a flag to LookupResult
that allows us to find names from dependent base classes where the base
is a specialization of a known template. The final LookupResult would
still return LookupResult::NotFoundInCurrentInstantiation, but it would
have a collection of Decls. If we find a real lookup result, we would
clear the flag and the existing lookup results and begin accumulating
only real lookup results.
We would structure the lookup as a secondary lookup between normal
lookup and typo correction for normal compilation, but for MSVC
compatibility mode, we would always enable this extra lookup into
dependent bases.
llvm-svn: 212566
Dmitry Vyukov [Tue, 8 Jul 2014 20:37:16 +0000 (20:37 +0000)]
tsan: reapply 212531 and 212532 with a fix
don't reset s->addr as well
llvm-svn: 212565
Alexey Samsonov [Tue, 8 Jul 2014 20:23:18 +0000 (20:23 +0000)]
Remove unnecessary check for NULL
llvm-svn: 212564
Saleem Abdulrasool [Tue, 8 Jul 2014 20:21:29 +0000 (20:21 +0000)]
test: merge arm-intrin into ms-intrin, fix invocation
This merges the two tests into one since there is no real reason to separate
them. It also fixes the test invocation to specify -fms-compatibility without
which we would end up without an Intrin.h header.
llvm-svn: 212563
Alexey Samsonov [Tue, 8 Jul 2014 20:17:19 +0000 (20:17 +0000)]
[TSan] Revert r212531 and r212532.
They cause "check-tsan" command to hang. Details in r212532 review thread.
llvm-svn: 212562
Reid Kleckner [Tue, 8 Jul 2014 20:05:48 +0000 (20:05 +0000)]
Allow more lookup of types in dependent base classes
MSVC appears to perform name lookup into dependent base classes when the
dependent base class has a known primary template. This allows them to
know whether some unqualified ids are types or not, which allows them to
parse more class templates without typename keywords.
We can do the same thing when type name lookup fails, and if we find a
single type decl in one of our dependent base classes, recover as though
the user wrote 'typename MyClass::TypeFromBase'.
This allows us to parse some COM smart pointer classes in wrl/client.h
from the Windows 8 SDK.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D4237
llvm-svn: 212561
Dmitry Vyukov [Tue, 8 Jul 2014 20:01:12 +0000 (20:01 +0000)]
tsan: allow memory overlap in __tsan_java_move
JVM actually moves memory between overlapping ranges.
llvm-svn: 212560
Jim Ingham [Tue, 8 Jul 2014 19:28:57 +0000 (19:28 +0000)]
Add the ability to provide a "count" option to the various "thread step-*" operations. Only
step-inst and step-inst are currently supported, the rest just warn that they are not supported
if you try to provide a count.
llvm-svn: 212559
Jim Ingham [Tue, 8 Jul 2014 19:27:35 +0000 (19:27 +0000)]
Document the "thread.completed-expression" feature in the "expression" command help.
llvm-svn: 212558
Nico Weber [Tue, 8 Jul 2014 18:34:46 +0000 (18:34 +0000)]
Don't pull in setjmp.h in -ffreestanding compiles.
Also provide _setjmpex(). r200243 put in _setjmp() and _setjmpex() behind a
comment since jmp_buf wasn't available. r200344 added jmp_buf and put in
_setjmp(), but missed _setjmpex().
llvm-svn: 212557
Nico Weber [Tue, 8 Jul 2014 18:29:27 +0000 (18:29 +0000)]
Replace a few // comments with /**/ comments in headers, for consistency.
llvm-svn: 212556
David Majnemer [Tue, 8 Jul 2014 18:18:04 +0000 (18:18 +0000)]
Sema: Don't allow CVR qualifiers before structors
We would silently accept volatile ~S() when the user probably intended
to write virtual ~S().
This fixes PR20238.
llvm-svn: 212555
Bruce Mitchener [Tue, 8 Jul 2014 18:09:58 +0000 (18:09 +0000)]
Revert accidental change to Xcode project.
llvm-svn: 212554
Bruce Mitchener [Tue, 8 Jul 2014 18:05:41 +0000 (18:05 +0000)]
Fix typos.
llvm-svn: 212553
Jean-Daniel Dupas [Tue, 8 Jul 2014 17:42:17 +0000 (17:42 +0000)]
Simplify Host::GetOSVersion() on macosx.
It removes usage of the deprecated function CFURLCreateDataAndPropertiesFromResource().
llvm-svn: 212552
Richard Smith [Tue, 8 Jul 2014 17:25:14 +0000 (17:25 +0000)]
PR20227: materialize a temporary when dynamic_casting a class prvalue to a
reference type.
llvm-svn: 212551
Pete Cooper [Tue, 8 Jul 2014 17:06:03 +0000 (17:06 +0000)]
Revert "GlobalDCE: Delete available_externally initializers if it allows removing the value the initializer is referring to."
This reverts commit
5b55a47e94e28fbb56d0cd5d72c3db9105c15b4c.
A test case was found to crash after this was applied. I'll file a bug to track fixing this with the test case needed.
llvm-svn: 212550
Benjamin Kramer [Tue, 8 Jul 2014 16:42:54 +0000 (16:42 +0000)]
As funny as it might look, this wasn't what I intended to test.
llvm-svn: 212549
Todd Fiala [Tue, 8 Jul 2014 16:29:54 +0000 (16:29 +0000)]
Remove hack from dotest.py to fix extra output on -P command, and fix MacOSX multi-threaded test run collisions on crashlog.dylib.
On MacOSX, we need to adjust the way we clean up the crashlog dylib in deleteCrashInfoDylib().
Right now it is only geared to run one test at a time. For now I'm just skipping the delete.
I'll work with Apple on a fix that handles this. It seems to only cause one dylib total to
hang around that might otherwise have been deleted. Fixes MacOSX multiple tests running
at the same time. (I didn't hit this on Yosemite, might be an issue that only shows up
on Mavericks?)
llvm-svn: 212548
Ulrich Weigand [Tue, 8 Jul 2014 16:16:02 +0000 (16:16 +0000)]
[PowerPC] Implement atomic NAND operations as actual NAND
This changes the implementation of atomic NAND operations
from "a & ~b" (compatible with GCC < 4.4) to actual "~(a & b)"
(compatible with GCC >= 4.4).
This is in line with the common-code and ARM back-end change
implemented in r212433.
llvm-svn: 212547
Benjamin Kramer [Tue, 8 Jul 2014 16:15:48 +0000 (16:15 +0000)]
Use explicit if and restore lost FileCheck error code checking.
llvm-svn: 212546
Benjamin Kramer [Tue, 8 Jul 2014 16:07:39 +0000 (16:07 +0000)]
Update unit test for signature change.
llvm-svn: 212545
Benjamin Kramer [Tue, 8 Jul 2014 16:07:36 +0000 (16:07 +0000)]
Turn some Twine locals into const char * variables.
No functionality change, just stylistic cleanup. Change made by clang-tidy
and clang-format.
llvm-svn: 212544
Todd Fiala [Tue, 8 Jul 2014 15:55:32 +0000 (15:55 +0000)]
Fix broken tests due to new error output.
This reverses out the options validators changes. We'll get these
back in once the changes to the output can be resolved.
Restores broken tests on FreeBSD, Linux, MacOSX.
Changes reverted: r212500, r212317, r212290.
llvm-svn: 212543
Simon Atanasyan [Tue, 8 Jul 2014 15:47:55 +0000 (15:47 +0000)]
[Mips] Make rel-dynamic-07.test test case independent from external input files.
llvm-svn: 212542
David Blaikie [Tue, 8 Jul 2014 15:46:02 +0000 (15:46 +0000)]
Improve memory ownership of vfs::Files in the FileSystemStatCache by using std::unique_ptr
Spotted after a memory leak (due to the complexities of manual memory
management) was fixed in 212466.
llvm-svn: 212541
Benjamin Kramer [Tue, 8 Jul 2014 15:41:20 +0000 (15:41 +0000)]
[clang-tidy] Address review comments for the Twine checker.
- Remove unused includes.
- Minor wording fix.
- Added support to check for clang-tidy messages to check_clang_tidy_fix.sh
= Updated test case.
llvm-svn: 212540
Andrea Di Biagio [Tue, 8 Jul 2014 15:22:29 +0000 (15:22 +0000)]
[DAG] Teach how to combine a pair of shuffles into a single shuffle if the resulting mask is legal.
This patch teaches how to fold a shuffle according to rule:
shuffle (shuffle (x, undef, M0), undef, M1) -> shuffle(x, undef, M2)
We do this only if the resulting mask M2 is legal; this is to avoid introducing
illegal shuffles that are potentially expanded into a sub-optimal sequence
of target specific dag nodes.
This patch has the advantage of being target independent, since it works on ISD
nodes. Therefore, all targets (not only x86) can take advantage of this rule.
The idea behind this patch is that most shuffle pairs can be safely combined
before we run the legalizer on vector operations. This allows us to
combine/simplify dag nodes earlier in the process and not only immediately
before instruction selection stage.
That said. This patch is not meant to replace any existing target specific
combine rules; backends might still introduce new shuffles during legalization
stage. Also, this rule is very simple and avoids to aggressively optimize
shuffles.
llvm-svn: 212539
Marshall Clow [Tue, 8 Jul 2014 15:19:40 +0000 (15:19 +0000)]
Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.
llvm-svn: 212538
Benjamin Kramer [Tue, 8 Jul 2014 14:55:06 +0000 (14:55 +0000)]
Fix some Twine locals.
Two of those are use after frees. Found by clang-tidy, fixed by me.
llvm-svn: 212537
Todd Fiala [Tue, 8 Jul 2014 14:52:11 +0000 (14:52 +0000)]
Fix broken MacOSX Xcode build for CommandOptionValidators.cpp.
llvm-svn: 212536
Benjamin Kramer [Tue, 8 Jul 2014 14:32:17 +0000 (14:32 +0000)]
[clang-tidy] Add a little checker for Twine locals in LLVM.
Those often cause use after free bugs and should be generally avoided.
Technically it is safe to have a Twine with >=2 components in a variable
but I don't think it is a good pattern to follow. The almost trivial checker
comes with elaborated fix-it hints that turn the Twine into a std::string
if necessary and otherwise fall back to the original type if the Twine
is created from a single value.
llvm-svn: 212535
Evgeniy Stepanov [Tue, 8 Jul 2014 14:15:23 +0000 (14:15 +0000)]
[msan] Fix out of bounds access in origin copying.
llvm-svn: 212534
Kostya Serebryany [Tue, 8 Jul 2014 13:40:08 +0000 (13:40 +0000)]
[tsan] Enable tsan's deadlock detector by default.
The tsan's deadlock detector has been used in Chromium for a while;
it found a few real bugs and reported no false positives.
So, it's time to give it a bit more exposure.
llvm-svn: 212533
Dmitry Vyukov [Tue, 8 Jul 2014 13:36:59 +0000 (13:36 +0000)]
tsan: fix a potential hang
idx0 is not updated in the branch,
so if we take that branch idx0 will stay updated forever
llvm-svn: 212532
Dmitry Vyukov [Tue, 8 Jul 2014 13:28:01 +0000 (13:28 +0000)]
tsan: fix a bug in metamap
The bug happens in the following case:
Mutex is located at heap block beginning,
when we call MutexDestroy, s->next is set to 0,
so free can't find the MBlock related to the block.
llvm-svn: 212531
Timur Iskhodzhanov [Tue, 8 Jul 2014 13:18:58 +0000 (13:18 +0000)]
[ASan/Win] Don't instrument private COMDAT globals until PR20244 is properly fixed
llvm-svn: 212530