Commit Graph

132801 Commits

Author SHA1 Message Date
Dmitry Vyukov b244c46c66 tsan: speed up allocator64 GetBlockBegin()
llvm-svn: 162908
2012-08-30 13:55:43 +00:00
Alexey Samsonov f54e3aaeaa Whitespace
llvm-svn: 162907
2012-08-30 13:47:13 +00:00
Richard Smith 5edd5830e1 Make preprocessor act in a GCC-compatible fashion when a macro is redefined
within its own argument list. The original definition is used for the immediate
expansion, but the new definition is used for any subsequent occurences within
the argument list or after the expansion.

llvm-svn: 162906
2012-08-30 13:38:46 +00:00
Dmitry Vyukov 7af8a3a83d tsan: simplify TSAN_HISTORY_SIZE code
llvm-svn: 162905
2012-08-30 13:29:11 +00:00
Richard Smith b3afa6c483 PR13652: Don't assume the parameter array on a FunctionTypeLoc for a lambda will
be filled in; they won't if the lambda's declarator has an invalid type. Instead
take the parameters from the declarator directly.

llvm-svn: 162904
2012-08-30 13:13:20 +00:00
Benjamin Kramer a49705e5b8 WWW: Force word wrapping of the content to avoid horizontal scrolling.
This isn't perfect but avoids overlap of the menu and the content.

llvm-svn: 162903
2012-08-30 13:12:02 +00:00
Dmitry Vyukov 191f2f7cdb tsan: use stack depot to describe heap blocks
llvm-svn: 162902
2012-08-30 13:02:30 +00:00
Tobias Grosser cd95b77330 Pocc: Fix some bugs in the PoCC optimizer pass
This includes:
  - The isl_id of the domain of the scattering must be copied from the original
    domain
  - Remove outdated references to a 'FinalRead' statement
  - Print of the Pocc output, if -debug is provided.
  - Add line breaks to some error messages.

Reported and Debugged by:  Dustin Feld  <d3.feld@gmail.com>

llvm-svn: 162901
2012-08-30 11:49:38 +00:00
Tobias Grosser 4a7527e0eb Pluto: Print pluto input in debugging mode
llvm-svn: 162900
2012-08-30 11:49:31 +00:00
Nadav Rotem d5f5777b77 It is illegal to transform (sdiv (ashr X c1) c2) -> (sdiv x (2^c1 * c2)),
because C always rounds towards zero.

Thanks Dirk and Ben.

llvm-svn: 162899
2012-08-30 11:23:20 +00:00
Tim Northover ca9f384ff8 Add support for moving pure S-register to NEON pipeline if desired
llvm-svn: 162898
2012-08-30 10:17:45 +00:00
Dmitry Vyukov f4792878c4 asan/tsan: first version of "stack depot"
llvm-svn: 162897
2012-08-30 10:02:48 +00:00
Nadav Rotem 9bf4e5d3f6 remove old docs
llvm-svn: 162896
2012-08-30 09:23:13 +00:00
Alexey Samsonov 45be793e3a Refactor fetching file/line info from DWARFContext to simplify the
code and allow better code reuse. Make the code a bit more conforming
to LLVM code style.
No functionality change.

llvm-svn: 162895
2012-08-30 07:49:50 +00:00
Craig Topper 2da13f9ef8 Add FMA to switch statement in VectorLegalizer::LegalizeOp so that it can be expanded when it isn't legal.
llvm-svn: 162894
2012-08-30 07:34:22 +00:00
Craig Topper c8f5d77e75 Add support for FMA to WidenVectorResult.
llvm-svn: 162893
2012-08-30 07:13:41 +00:00
Craig Topper e39ad7b549 Only perform DAG combine on FMAs of legal types.
llvm-svn: 162892
2012-08-30 06:56:15 +00:00
Ted Kremenek 53f3e7dba3 Change -analyzer-config to use '=' as the key-value separator, and only
support the '-analyzer-config key=val' variant.

llvm-svn: 162891
2012-08-30 05:49:16 +00:00
Nico Weber 723b4f02a7 Reland r160052: Default to -std=c++11 on Windows.
Also update the tests that rely on c++98 to explicitly mention that.

llvm-svn: 162890
2012-08-30 02:08:31 +00:00
Nico Weber 077a53e5ab Tooling: Add a runToolOnCodeWithArgs() function that allows
passing additional parameters to a tool.

Use this to fix a FIXME in testing code.

llvm-svn: 162889
2012-08-30 02:02:19 +00:00
Bill Wendling 14c8a051ca Pass by pointer and not std::string.
llvm-svn: 162888
2012-08-30 01:32:31 +00:00
Michael Liao b94f47a8f5 Fix C++ comment in C source
llvm-svn: 162887
2012-08-30 00:45:32 +00:00
Eli Friedman 448ce40426 Fix a crash in type merging with enum types.
llvm-svn: 162886
2012-08-30 00:44:15 +00:00
Michael Liao 271f11b571 Should put test case under test/ExecutionEngine/MCJIT/
llvm-svn: 162885
2012-08-30 00:43:57 +00:00
Bill Wendling 8c0b4bc339 Emit .gcda files as absolute paths instead of relative paths.
This improves compatibility with gcc in this regard, and this file generation
can be ameliorated with GCOV_PREFIX and GCOV_PREFIX_STRIP. It's also useful if
your build directory doesn't specify -o <abspath> and it uses a recursive make
structure, so it's not relative to the toplevel.

Patch by Joshua Cranmer!
<rdar://problem/12179524>

llvm-svn: 162884
2012-08-30 00:43:41 +00:00
Bill Wendling 1f6f8c2cb7 Revert r162855 in favor of changing clang to emit the absolute coverage file path.
llvm-svn: 162883
2012-08-30 00:34:21 +00:00
Will Dietz 2df50b715c Fix HashString's Bernstein hash to use unsigned chars, as is usually done.
Changes the hash result for strings containing characters
with values >= 128, such as UTF8 strings (not normal ASCII).

Changed mostly so we match other implementations.

llvm-svn: 162882
2012-08-30 00:30:21 +00:00
Michael Liao 3c8980646b Fix PR13727
- The root cause is that target constant materialization in X86 fast-isel
  creates a PC-rel addressing which may overflow 32-bit range in non-Small code
  model if .rodata section is allocated too far away from code segment in
  MCJIT, which uses Large code model so far.
- Follow the similar logic to fix non-Small code model in fast-isel by skipping
  non-Small code model.

llvm-svn: 162881
2012-08-30 00:30:16 +00:00
Ted Kremenek 2aa89dd03e Make this test portable.
llvm-svn: 162880
2012-08-30 00:27:25 +00:00
Jakob Stoklund Olesen 44a7cf73f2 Add a bit of documentation to copyPhysReg.
llvm-svn: 162879
2012-08-29 23:52:55 +00:00
Jakob Stoklund Olesen ffba07b927 Verify the order of tied operands in inline asm.
When there are multiple tied use-def pairs on an inline asm instruction,
the tied uses must appear in the same order as the defs.

It is possible to write an LLVM IR inline asm instruction that breaks
this constraint, but there is no reason for a front end to emit the
operands out of order.

The gnu inline asm syntax specifies tied operands as a single read/write
constraint "+r", so ouf of order operands are not possible.

llvm-svn: 162878
2012-08-29 23:52:52 +00:00
Benjamin Kramer f470f08463 Explicitly cast an expression to bool before handing it off to __builtin_expect.
Avoids surprises when someone uses LLVM_(UN)LIKELY with an integer.

llvm-svn: 162877
2012-08-29 23:28:45 +00:00
Anna Zaks 256127388a [analyzer] Stop tracking symbols based on a retain count summary of
inlined function.

This resolves retain count checker false positives that are caused by
inlining ObjC and other methods. Essentially, if we are passing an
object to a method with "delegate" in the selector or a function pointer
as another argument, we should stop tracking the other parameters/return
value as far as the retain count checker is concerned.

llvm-svn: 162876
2012-08-29 23:23:43 +00:00
Anna Zaks 07a821fb17 [analyzer] Fixup 162863.
Thanks Jordan.

llvm-svn: 162875
2012-08-29 23:23:39 +00:00
Benjamin Kramer ffa24e0438 Add some __builtin_expect magic to StringMap.
Tombstones and full hash collisions are rare, mark the "empty"
and "no collision" paths as likely. The bug in simplifycfg
that prevented the hints from being picked during selfhost
up was fixed recently :)

llvm-svn: 162874
2012-08-29 22:57:04 +00:00
Benjamin Kramer bd7f8d0260 Replace the BUILTIN_EXPECT macro with a less horrible LLVM_LIKELY/LLVM_UNLIKELY interface.
llvm-svn: 162873
2012-08-29 22:57:00 +00:00
Ted Kremenek 7712eef0d7 Fix serious regression introduced in r157780 where __attribute__((NSObject))
could not be attached to a CFTypeRef.

Fixes <rdar://problem/12197822>

llvm-svn: 162872
2012-08-29 22:54:47 +00:00
Sean Callanan e635db4923 Fixed a potential crash in PlatformLinux if
ModuleList::GetSharedModule() returned NULL.

<rdar://problem/12182971>

llvm-svn: 162871
2012-08-29 22:34:39 +00:00
Owen Anderson 9d0f923e7c Allow targets to specify a minimum supported NOP size when performing NOP padding. If the desired padding is smaller than the supported NOP size,
we will enlarge the padding to make it work.

llvm-svn: 162870
2012-08-29 22:18:56 +00:00
Jakob Stoklund Olesen b2bef482fd Set the isTied flags when building INLINEASM MachineInstrs.
For normal instructions, isTied() is set automatically by addOperand(),
based on MCInstrDesc, but inline asm has tied operands outside the
descriptor.

llvm-svn: 162869
2012-08-29 22:02:00 +00:00
Andrew Trick 3051aa1cb8 Preserve branch profile metadata during switch formation.
Patch by Michael Ilseman!
This fixes SimplifyCFGOpt::FoldValueComparisonIntoPredecessors to preserve metata when folding conditional branches into switches.

void foo(int x) {
  if (x == 0)
    bar(1);
  else if (__builtin_expect(x == 10, 1))
    bar(2);
  else if (x == 20)
    bar(3);
}

CFG:

B0
|  \
|   X0
B10
|  \
|   X10
B20
|  \
E   X20

Merge B0-B10:
w(B0-X0) = w(B0-X0)*sum-weights(B10) = w(B0-X0) * (w(B10-X10) + w(B10-B20))
w(B0-X10) = w(B0-B10) * w(B10-X10)
w(B0-B20) = w(B0-B10) * w(B10-B20)

B0 __
| \  \
| X10 X0
B20
|  \
E  X20

Merge B0-B20:
w(B0-X0) = w(B0-X0) * sum-weights(B20) = w(B0-X0) * (w(B20-E) + w(B20-X20))
w(B0-X10) = w(B0-X10) * sum-weights(B20) = ...
w(B0-X20) = w(B0-B20) * w(B20-X20)
w(B0-E) = w(B0-B20) * w(B20-E)

llvm-svn: 162868
2012-08-29 21:46:38 +00:00
Andrew Trick f3cf1932b3 whitespace
llvm-svn: 162867
2012-08-29 21:46:36 +00:00
Eli Friedman 8087378f09 Fix PR reference in test.
llvm-svn: 162866
2012-08-29 21:27:50 +00:00
Eli Friedman 9a38121fc5 Fix run-line for test.
llvm-svn: 162865
2012-08-29 21:25:58 +00:00
Anna Zaks f329823dc0 [analyzer]Fix typo, unbreak static analyzer BuildBot (at least
partially).

(Addresses a regression from r162790.)

llvm-svn: 162864
2012-08-29 21:22:40 +00:00
Anna Zaks 5d4ec36323 [analyzer] Improved diagnostic pruning for calls initializing values.
This heuristic addresses the case when a pointer (or ref) is passed
to a function, which initializes the variable (or sets it to something
other than '0'). On the branch where the inlined function does not
set the value, we report use of undefined value (or NULL pointer
dereference). The access happens in the caller and the path
through the callee would get pruned away with regular path pruning. To
solve this issue, we previously disabled diagnostic pruning completely
on undefined and null pointer dereference checks, which entailed very
verbose diagnostics in most cases. Furthermore, not all of the
undef value checks had the diagnostic pruning disabled.

This patch implements the following heuristic: if we pass a pointer (or
ref) to the region (on which the error is reported) into a function and
it's value is either undef or 'NULL' (and is a pointer), do not prune
the function.

llvm-svn: 162863
2012-08-29 21:22:37 +00:00
Eli Friedman 504f9a2872 Make alignment computation for pointer values for builtins handle
non-pointer types with a pointer representation correctly. PR13660.

llvm-svn: 162862
2012-08-29 21:21:11 +00:00
Jakob Stoklund Olesen cea3e77433 Rename hasVolatileMemoryRef() to hasOrderedMemoryRef().
Ordered memory operations are more constrained than volatile loads and
stores because they must be ordered with respect to all other memory
operations.

llvm-svn: 162861
2012-08-29 21:19:21 +00:00
Greg Clayton 1f7460716b <rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". 
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()

Cleaned up header includes a bit as well.

llvm-svn: 162860
2012-08-29 21:13:06 +00:00
Jakob Stoklund Olesen 23793141a1 Add MachineMemOperand::isUnordered().
This means the same as LoadInst/StoreInst::isUnordered(), and implies
!isVolatile().

Atomic loads and stored are also ordered, and this is the right method
to check if it is safe to reorder memory operations. Ordered atomics
can't be reordered wrt normal loads and stores, which is a stronger
constraint than volatile.

llvm-svn: 162859
2012-08-29 21:08:52 +00:00