Commit Graph

158266 Commits

Author SHA1 Message Date
David Blaikie 0f5ad28a9d Fix a typo and simplify a boolean expression.
llvm-svn: 191018
2013-09-19 17:27:48 +00:00
Shuxin Yang 74c9a170b8 GVN proceeds in the presence of dead code.
This is how it ignores the dead code:
1) When a dead branch target, say block B, is identified, all the
    blocks dominated by B is dead as well.

2) The PHIs of those blocks in dominance-frontier(B) is updated such
   that the operands corresponding to dead predecessors are replaced
   by "UndefVal".

   Using lattice's jargon, the "UndefVal" is the "Top" in essence.
   Phi node like this "phi(v1 bb1, undef xx)" will be optimized into
   "v1" if v1 is constant, or v1 is an instruction which dominate this
   PHI node.

3) When analyzing the availability of a load L, all dead mem-ops which
   L depends on disguise as a load which evaluate exactly same value as L.

4) The dead mem-ops will be materialized as "UndefVal" during code motion.

llvm-svn: 191017
2013-09-19 17:22:51 +00:00
Fariborz Jahanian 5c005839f6 Refinement to my previous patch for
objc_returns_inner_pointer on properties. // rdar://14990439

llvm-svn: 191016
2013-09-19 17:18:55 +00:00
Reid Kleckner ab675128e9 msbuild: Set _MSC_VER to match the CRT we're using
Various Windows SDK headers use _MSC_VER values to figure out what
version of the VC++ headers they're using, in particular for SAL macros.

Patch by Paul Hampson!

llvm-svn: 191015
2013-09-19 17:18:35 +00:00
Shuxin Yang a9df0db27d Add function DominatorTree::getDescendants().
As its name suggests, this function will return all basic blocks
dominated by a given block.

llvm-svn: 191014
2013-09-19 17:18:35 +00:00
Alexander Potapenko 8f5d907aea [ASan] Fix init-order-dlopen.cc test to not depend on the -Wl,-undefined,dynamic_lookup being passed to the linker.
llvm-svn: 191012
2013-09-19 17:12:45 +00:00
Reid Kleckner 81e6a60efa clang-cl: Accept -fmsc-version so we can set it without -Xclang
llvm-svn: 191011
2013-09-19 17:00:54 +00:00
Reid Kleckner 58c16ee609 Include an LLVM-vs2012_xp toolset in the MSBuild integration
Patch by Paul Hampson!

llvm-svn: 191010
2013-09-19 16:50:40 +00:00
Fariborz Jahanian 8a5e947454 ObjectiveC: Allow NS_RETURNS_INNER_POINTER annotation
of ObjectiveC properties to mean annotation of 
NS_RETURNS_INNER_POINTER on its synthesized getter.
This also facilitates more migration to properties when 
methods are annotated with NS_RETURNS_INNER_POINTER. 
// rdar://14990439

llvm-svn: 191009
2013-09-19 16:37:20 +00:00
Evgeniy Stepanov 37b8645480 [msan] Wrap indirect functions.
Adds a flag to the MemorySanitizer pass that enables runtime rewriting of
indirect calls. This is part of MSanDR implementation and is needed to return
control to the DynamiRio-based helper tool on transition between instrumented
and non-instrumented modules. Disabled by default.

llvm-svn: 191006
2013-09-19 15:22:35 +00:00
Ed Maste 7c0f2ce467 Assert that only reg- or word-sized values are byte swapped
Targets and hosts today are little-endian (arm, x86), so this change
should be a no-op as they will not encounter the byte swapping cases.

Byte swapping  will happen when cross debugging of big endian-targets
(e.g. MIPS, PPC) on a little-endian host (x86).  Register- or word-
sized data copies need to be swapped, but calls to ExtractBytes or
CopyByteOrderedData that would invoke the swapping case are presumably
in error.

llvm-svn: 191005
2013-09-19 15:12:36 +00:00
Kostya Serebryany f8bbdfaf95 [asan] fix one more async-signal-safety issue with use-after-return
llvm-svn: 191004
2013-09-19 14:59:52 +00:00
Ben Langmuir ed6e97d2c3 Fix ifdef macro missed in previous commit
llvm-svn: 191003
2013-09-19 14:07:14 +00:00
Ben Langmuir 6efe3a886e Move sha intrinsics to immintrin.h
This is consistent with ICC and Intel's SHA-enabled GCC version.

llvm-svn: 191002
2013-09-19 14:00:22 +00:00
Amara Emerson fc362c62bf [ARMv8] Add crypto-neon-fp-armv8 -mfpu option in driver.
llvm-svn: 191001
2013-09-19 13:54:03 +00:00
Benjamin Kramer d443e4a080 DAGCombiner: Don't fold vector muls with constants that look like a splat of a power of 2 but differ in bit width.
PR17283.

llvm-svn: 191000
2013-09-19 13:28:20 +00:00
Ben Langmuir 58078d0103 Add C intrinsics for Intel SHA Extensions
Intrinsics added shaintrin.h, which is included from x86intrin.h if __SHA__ is
enabled. SHA implies SSE2, which is needed for the __m128i type.

Also add the -msha/-mno-sha option.

llvm-svn: 190999
2013-09-19 13:22:04 +00:00
Justin Holewinski a54daa4640 [NVPTX] Make constant vector test case endian-independent
llvm-svn: 190998
2013-09-19 13:14:44 +00:00
Justin Holewinski 95564bdf5e [NVPTX] Support constant vector globals
llvm-svn: 190997
2013-09-19 12:51:46 +00:00
Amara Emerson 3308909508 [ARMv8] Add support for the v8 cryptography extensions.
llvm-svn: 190996
2013-09-19 11:59:01 +00:00
Tim Northover 97347a81bc X86: FrameIndex addressing modes do have a base register.
When selecting the DAG (add (WrapperRIP ...), (FrameIndex ...)), X86 code had
spotted the FrameIndex possibility and was working out whether it could fold
the WrapperRIP into this.

The test for forming a %rip version is notionally whether we already have a
base or index register (%rip precludes both), but we were forgetting to account
for the register that would be inserted later to access the frame.

rdar://problem/15024520

llvm-svn: 190995
2013-09-19 11:33:53 +00:00
Alexey Samsonov 786ee9b1ad [MSan] Fix -Wempty-body warning
llvm-svn: 190994
2013-09-19 08:35:16 +00:00
Alexey Samsonov 1c5cd7516f [TSan] Fix -Wempty-body warning
llvm-svn: 190993
2013-09-19 07:59:18 +00:00
Alexey Samsonov 2a8fcee302 Don't use default label in fully covered switch
llvm-svn: 190992
2013-09-19 07:35:47 +00:00
Dmitry Vyukov d78bc3aa11 asan/tsan/msan: use builtin atomic operations when available
this should fix episodic crashes on ARM/PPC
x86_32 is still broken

llvm-svn: 190991
2013-09-19 06:02:56 +00:00
Andrew Trick b5e1e6cc11 Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."
Working on a better solution to this.

This reverts commit 7d4e9934e7ca83094c5cf41346966c8350179ff2.

llvm-svn: 190990
2013-09-19 06:02:43 +00:00
Dmitry Vyukov f54631dcfe tsan: prevent the following false positive due to __cxa_atexit
WARNING: ThreadSanitizer: data race (pid=29103)
  Write of size 8 at 0x7d64003bbf00 by main thread:
    #0 free tsan_interceptors.cc:477
    #1 __run_exit_handlers <null>:0 (libc.so.6+0x000000050cb7)

  Previous write of size 8 at 0x7d64003bbf00 by thread T78 (mutexes: write M9896):
    #0 calloc tsan_interceptors.cc:449
    #1 ...

llvm-svn: 190989
2013-09-19 04:48:59 +00:00
Dmitry Vyukov c2437ffc23 tsan: consistently use thr instead of cur_thread() in annotations implementation
llvm-svn: 190988
2013-09-19 04:42:25 +00:00
Dmitry Vyukov 1a7ca92006 tsan: refactor internal IgnoreCtl interface
llvm-svn: 190987
2013-09-19 04:39:04 +00:00
Rui Ueyama 1bddfc1fc7 [PECOFF][Driver] Support /version command line option
llvm-svn: 190986
2013-09-19 02:37:36 +00:00
Reid Kleckner 2f7fe8acb3 Use -ffreestanding in ms-intrin.cpp and define size_t manually.
llvm-svn: 190985
2013-09-19 01:54:40 +00:00
Eli Friedman 29749d2e3b Fix use-after-free in r190980.
llvm-svn: 190984
2013-09-19 01:51:23 +00:00
Rui Ueyama 0397239f6b [PECOFF] Fix the order of the Import Table entries.
Test is coming after submitting http://llvm-reviews.chandlerc.com/D1719.

llvm-svn: 190983
2013-09-19 01:39:53 +00:00
Craig Topper 2956112308 Use curly braces all the way through long if/else chain for consistency and readability.
llvm-svn: 190982
2013-09-19 01:13:07 +00:00
Eli Friedman 7127108357 Fix crash with cast of value-dependent expr.
We don't really need to perform semantic analysis on the dependent expression
anyway, so just call the cast dependent.

<rdar://problem/15012610>

llvm-svn: 190981
2013-09-19 01:12:33 +00:00
Eli Friedman 0834a4b901 Make Preprocessor::Lex non-recursive.
Before this patch, Lex() would recurse whenever the current lexer changed (e.g.
upon entry into a macro). This patch turns the recursion into a loop: the
various lex routines now don't return a token when the current lexer changes,
and at the top level Preprocessor::Lex() now loops until it finds a token.
Normally, the recursion wouldn't end up being very deep, but the recursion depth
can explode in edge cases like a bunch of consecutive macros which expand to
nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this
patch).

<rdar://problem/14569770>

llvm-svn: 190980
2013-09-19 00:41:32 +00:00
Reid Kleckner 5cc15addbe Avoid including <stdlib.h> in the intrin.h test
llvm-svn: 190979
2013-09-19 00:32:11 +00:00
Reid Kleckner f0e232287a Fix ifdef ordering at the end of Intrin.h from r190965
Test that intrin.h at least parses in C++ TUs.

llvm-svn: 190978
2013-09-19 00:19:53 +00:00
Craig Topper 5f79e2661d Disabling sse2 should disable aes and pclmul support.
llvm-svn: 190977
2013-09-19 00:01:05 +00:00
Andrew Trick f33d6df899 Encapsulate PassManager debug flags to avoid static init and cxa_exit.
This puts all the global PassManager debugging flags, like
-print-after-all and -time-passes, behind a managed static. This
eliminates their static initializers and, more importantly, exit-time
destructors.

The only behavioral change I anticipate is that tools need to
initialize the PassManager before parsing the command line in order to
export these options, which makes sense. Tools that already initialize
the standard passes (opt/llc) don't need to do anything new.

llvm-svn: 190974
2013-09-18 23:31:16 +00:00
Andrew Trick dc073addc5 whitespace
llvm-svn: 190973
2013-09-18 23:31:10 +00:00
Eli Friedman 626956111d Add specific warning flags for GNU ext in Sema.
This patch adds the following, more specific warning flags:

gnu-anonymous-struct
gnu-compound-literal-initializer
gnu-empty-struct
gnu-flexible-array-initializer
gnu-flexible-array-union-member
gnu-folding-constant
redeclared-class-member
gnu-redeclared-enum
gnu-union-cast
gnu-variable-sized-type-not-at-end

Patch by Peter Lewis.

llvm-svn: 190972
2013-09-18 23:23:17 +00:00
Eli Friedman f9edb00fa4 Fix CharByteWidth assertion in LiteralSupport.
Patch by Eelis van der Weegen.

llvm-svn: 190971
2013-09-18 23:23:13 +00:00
Richard Smith 7506e6bf25 Remove a bogus diagnostic preventing static data member templates from being
defined with no initializer.

llvm-svn: 190970
2013-09-18 23:09:24 +00:00
Adrian Prantl d913c86b93 don't use CHECK-NEXT because it may be on the same line.
llvm-svn: 190969
2013-09-18 23:01:54 +00:00
Sean Callanan c370a8a2f0 Made SymbolFileDWARF not crash if a function doesn't
have a type.  It does warn, though.

llvm-svn: 190968
2013-09-18 22:59:55 +00:00
Adrian Prantl 7f6f3bb86b Massage those regexps to work with both lldb and gdb.
llvm-svn: 190967
2013-09-18 22:56:35 +00:00
Reed Kotler d6aadc797c Fix two issues regarding Got pointer (GP) setup.
1) make sure that the first two instructions of the sequence cannot
separate from each other. The linker requires that they be sequential.
If they get separated, it can still work but it will not work in all
cases because the first of the instructions mostly involves the hi part
of the pc relative offset and that part changes slowly. You would have
to be at the right boundary for this to matter.
2) make sure that this sequence begins  on a longword boundary. 
There appears to be a bug in binutils which makes some of these calculations
get messed up if the instruction sequence does not begin on a longword
boundary. This is being investigated with the appropriate binutils folks.

llvm-svn: 190966
2013-09-18 22:46:09 +00:00
Eric Christopher cc87253f90 Fix closing brace around ifdef.
llvm-svn: 190965
2013-09-18 22:40:18 +00:00
Hans Wennborg 9cb7d9ba94 clang-cl: Don't warn about overriding /MD with /MT, /Fo with another /Fo, etc.
I put in the warnings because MSVC has them, but I don't think they're very
useful.

Clang does not warn about overriding flags in general, e.g. it's perfectly
fine to have -fomit-frame-pointer followed by -fno-omit-frame-pointer.

We should focus on warning where things get confusing, such as with the
/TP and /TC options. In "clang-cl /TC a.c /TP b.cc", the user might not
realize that the /TP flag will apply to both files, and we warn about that.

Differential Revision: http://llvm-reviews.chandlerc.com/D1718

llvm-svn: 190964
2013-09-18 22:26:39 +00:00