Commit Graph

135054 Commits

Author SHA1 Message Date
Micah Villmow ccbcf3876f Backing out my changes, something screwed up from my patches, starting over.
llvm-svn: 165253
2012-10-04 21:08:50 +00:00
Enrico Granata 7b8c0389e1 <rdar://problem/12424824> Making sure that we correctly update our synthetic children provider for NSArray - the same work will need to be done for NSDictionary
llvm-svn: 165252
2012-10-04 21:04:46 +00:00
Micah Villmow f66f83a1b1 Rename TargetData to DataLayout in DataLayout.cpp. This should fix a build failure from r165249 where the wrong version of the file was submitted.
llvm-svn: 165251
2012-10-04 20:49:16 +00:00
Eric Christopher 13319578ea Update this a bit more to represent how the prologue should work:
a) frame setup instructions define the prologue
b) we shouldn't change our location mid-stream

Add a test to make sure that the stack adjustment stays within
the prologue.

llvm-svn: 165250
2012-10-04 20:46:14 +00:00
Micah Villmow 4639774625 Create the DataLayout class, as a direct copy of TargetData.
llvm-svn: 165249
2012-10-04 20:44:22 +00:00
Bill Schmidt 7af848bf1f Fix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.
llvm-svn: 165247
2012-10-04 20:33:57 +00:00
Andrew Kaylor 5e7d792689 Adding MCJIT and MemoryBuffer unit tests
Patch by Daniel Malea.

llvm-svn: 165246
2012-10-04 20:29:44 +00:00
Bill Schmidt a7b7f7256e Add a test case for r156143, which enabled general varargs support for the
64-bit PPC SVR4 ABI.

The test verifies passing of structures, items with 16-byte alignment, and
small items that are passed right-justified in the parameter save area slot.

llvm-svn: 165245
2012-10-04 20:18:38 +00:00
Micah Villmow f3b796ed81 Accidently checked in the files, only wanted to copy them.
llvm-svn: 165244
2012-10-04 20:08:28 +00:00
Micah Villmow f854bfc7b7 (no commit message)
llvm-svn: 165243
2012-10-04 20:06:07 +00:00
Micah Villmow 325ccf3315 (no commit message)
llvm-svn: 165242
2012-10-04 20:05:12 +00:00
Michael Liao f54249b55f Add register encoding support in X86 backend
- Add 'HwEncoding' for X86 registers and call getEncodingValue() to
  retrieve their encoding values.
- This's the first step to adopt new scheme. Furthur revising is onging.

llvm-svn: 165241
2012-10-04 19:50:43 +00:00
Benjamin Kramer 058666a8d0 Driver: Link crtfastmath.o if it's available and -ffast-math is specified.
crtfastmath.o contains routines to set the floating point flags to a faster,
unsafe mode. Linking it in speeds up code dealing with denormals significantly
(PR14024).

For now this is only enabled on linux where I can test it and crtfastmath.o is
widely available. We may want to provide a similar file with compiler-rt
eventually and/or enable it on other platforms too.

llvm-svn: 165240
2012-10-04 19:42:20 +00:00
Jakub Staszak fe5e770c6d Fix doxygen comment to match parameters' names.
llvm-svn: 165239
2012-10-04 19:10:44 +00:00
Jakub Staszak e076cac097 Add a comment to the commit r165187.
llvm-svn: 165238
2012-10-04 19:08:30 +00:00
Will Schmidt 4a67f2e2a7 - add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
"Instruction 'foo' has no tokens" errors during llvm-tblgen
-gen-asm-matcher attempts.  At this time, the added
tokens are "#comment" style rather than the actual mnemonic.  This will
be revisited once the rest of the base asmparser bits get straightened
out for ppc64-elf-linux.

llvm-svn: 165237
2012-10-04 18:14:28 +00:00
Jakob Stoklund Olesen 878d386b9a Get MCSchedModel directly from the subtarget.
Not all targets have itineraries, but the subtarget always has an
MCSchedModel.

llvm-svn: 165236
2012-10-04 17:30:43 +00:00
Jakob Stoklund Olesen 8982222917 Switch MachineTraceMetrics to the new TargetSchedModel interface.
llvm-svn: 165235
2012-10-04 17:30:40 +00:00
Michael Han 360d225ae9 Fix scope location when parsing GNU attributes.
For GNU attributes, instead of reusing attribute source 
location for the scope location, use SourceLocation() since 
GNU attributes don not have scope tokens. 

llvm-svn: 165234
2012-10-04 16:42:52 +00:00
Will Schmidt 2247f8afbd test commit / whitespace
llvm-svn: 165233
2012-10-04 16:20:24 +00:00
Benjamin Kramer d12e82e523 SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.
We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.

llvm-svn: 165232
2012-10-04 16:11:49 +00:00
Preston Gurd 5ea246cf13 Revert 165129
llvm-svn: 165231
2012-10-04 15:26:04 +00:00
Dmitry Vyukov 6d5bd599c2 tsan for Go: support mallocs before __tsan_init() (required to support cgo code)
llvm-svn: 165229
2012-10-04 13:54:49 +00:00
Duncan Sands a6d20010fe In my recent change to avoid use of underaligned memory I didn't notice that
cpyDest can be mutated in some cases, which would then cause a crash later if
indeed the memory was underaligned.  This brought down several buildbots, so
I guess the underaligned case is much more common than I thought!

llvm-svn: 165228
2012-10-04 13:53:21 +00:00
Alexander Potapenko d2f6b97417 Avoid calling __asan_init from memcpy(), memmove(), memset() during libSystem initialization.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=117.

llvm-svn: 165227
2012-10-04 13:41:28 +00:00
Duncan Sands 271ea6cdc5 The alignment of an sret parameter is known: it must be at least the
alignment of the return type.  Teach the optimizers this.

llvm-svn: 165226
2012-10-04 13:36:31 +00:00
Benjamin Kramer 64ddcb0da6 Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.
llvm-svn: 165225
2012-10-04 13:12:43 +00:00
Duncan Sands 484c96bbdb Fix wrong name in comment.
llvm-svn: 165224
2012-10-04 13:07:26 +00:00
Chandler Carruth ac8317fd36 Fix PR13969, a mini-phase-ordering issue with the new SROA pass.
Currently, we re-visit allocas when something changes about the way they
might be *split* to allow better scalarization to take place. However,
we weren't handling the case when the *promotion* is what would change
the behavior of SROA. When an address derived from an alloca is stored
into another alloca, we consider the first to have escaped. If the
second is ever promoted to an SSA value, we will suddenly be able to run
the SROA pass on the first alloca.

This patch adds explicit support for this form if iteration. When we
detect a store of a pointer derived from an alloca, we flag the
underlying alloca for reprocessing after promotion. The logic works hard
to only do this when there is definitely going to be promotion and it
might remove impediments to the analysis of the alloca.

Thanks to Nick for the great test case and Benjamin for some sanity
check review.

llvm-svn: 165223
2012-10-04 12:33:50 +00:00
Alexey Samsonov 3197f8e6cb [ASan] don't build 64-bit runtime on 32-bit Linux platforms
llvm-svn: 165222
2012-10-04 12:22:33 +00:00
Duncan Sands c6ada69a14 The memcpy optimizer was happily doing call slot forwarding when the new memory
was less aligned than the old.  In the testcase this results in an overaligned
memset: the memset alignment was correct for the original memory but is too much
for the new memory.  Fix this by either increasing the alignment of the new
memory or bailing out if that isn't possible.  Should fix the gcc-4.7 self-host
buildbot failure.

llvm-svn: 165220
2012-10-04 10:54:40 +00:00
Chandler Carruth 43c8b46deb Teach the integer-promotion rewrite strategy to be endianness aware.
Sorry for this being broken so long. =/

As part of this, switch all of the existing tests to be Little Endian,
which is the behavior I was asserting in them anyways! Add in a new
big-endian test that checks the interesting behavior there.

Another part of this is to tighten the rules abotu when we perform the
full-integer promotion. This logic now rejects cases where there fully
promoted integer is a non-multiple-of-8 bitwidth or cases where the
loads or stores touch bits which are in the allocated space of the
alloca but are not loaded or stored when accessing the integer. Sadly,
these aren't really observable today as the rest of the pass will
already ensure the invariants hold. However, the latter situation is
likely to become a potential concern in the future.

Thanks to Benjamin and Duncan for early review of this patch. I'm still
looking into whether there are further endianness issues, please let me
know if anyone sees BE failures persisting past this.

llvm-svn: 165219
2012-10-04 10:39:28 +00:00
Dmitry Vyukov b96a7b5aa5 tsan: add atomic_fetch_sub() and atomic_signal_fence() functions
llvm-svn: 165218
2012-10-04 10:08:23 +00:00
Benjamin Kramer 4f23bee060 Prefer StringRef::startswith to the strncmp/strlen contraption.
This may be slightly more efficient and is definitely more readable.

llvm-svn: 165217
2012-10-04 10:06:38 +00:00
Logan Chien cd679fda6c Fix typo in comments.
llvm-svn: 165216
2012-10-04 08:08:56 +00:00
Axel Naumann c6848efaac Fix r165005: The lexical DeclContext is not the right place to make a decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit.
llvm-svn: 165215
2012-10-04 07:34:43 +00:00
Kostya Serebryany cb13fff13d [asan] properly report mmap failure
llvm-svn: 165214
2012-10-04 07:21:09 +00:00
Bill Wendling db0dbd8868 Use method to query if there are attributes.
llvm-svn: 165213
2012-10-04 07:19:46 +00:00
Bill Wendling daf8e38ba8 Add method to query for NoCapture attribute.
llvm-svn: 165212
2012-10-04 07:18:12 +00:00
Bill Wendling 5d637b7d5b Use method to query for NoAlias attribute.
llvm-svn: 165211
2012-10-04 07:17:46 +00:00
Bill Wendling 1960fbbd16 Use attribute query methods.
llvm-svn: 165210
2012-10-04 07:08:30 +00:00
Bill Wendling e8619aa1c1 Use method to query for attributes.
llvm-svn: 165209
2012-10-04 06:58:52 +00:00
Bill Wendling d777398ee4 Add method to query for 'NoAlias' attribute on call/invoke instructions.
llvm-svn: 165208
2012-10-04 06:52:09 +00:00
Bill Wendling d0935f7069 Use method to query for attributes.
llvm-svn: 165207
2012-10-04 06:49:41 +00:00
Bill Wendling 9cae65918c Query for attributes via the correct method call.
llvm-svn: 165206
2012-10-04 06:48:57 +00:00
Bill Wendling b0a290ef9e Use new accessor methods to query for attributes.
llvm-svn: 165205
2012-10-04 06:43:21 +00:00
Kostya Serebryany d23b18fe7f [tsan] add 3 internal flags for fine-grain control of what is instrumented and what is not.
llvm-svn: 165204
2012-10-04 05:28:50 +00:00
Craig Topper 54b69d4c0d Remove template from function that is only used with one type after r165092.
llvm-svn: 165203
2012-10-04 05:18:31 +00:00
Nick Lewycky 37eb038a66 Add missing comment for mangling.
llvm-svn: 165202
2012-10-04 04:58:17 +00:00
Lang Hames 8ce99f296b Fix reg mask slot test, and preserve LiveIntervals and VirtRegMap in the PBQP
allocator. Fixes PR13945.

llvm-svn: 165201
2012-10-04 04:50:53 +00:00