Commit Graph

128633 Commits

Author SHA1 Message Date
Hal Finkel 41e6fd1df9 Remove the TODO statement in the PPC README re: CTR loops
As Chris points out, this can now be removed!

TODO: check if the associated section on viterbi's inner loop can also be removed.
llvm-svn: 158224
2012-06-08 20:02:09 +00:00
Hal Finkel c6b5debb40 Enable PPC CTR loop formation by default.
Thanks to Jakob's help, this now causes no new test suite failures!

Over the entire test suite, this gives an average 1% speedup. The largest speedups are:
SingleSource/Benchmarks/Misc/pi - 108%
SingleSource/Benchmarks/CoyoteBench/lpbench - 54%
MultiSource/Benchmarks/Prolangs-C/unix-smail/unix-smail - 50%
SingleSource/Benchmarks/Shootout/ary3 - 32%
SingleSource/Benchmarks/Shootout-C++/matrix - 30%

The largest slowdowns are:
MultiSource/Benchmarks/mediabench/gsm/toast/toast - -30%
MultiSource/Benchmarks/Prolangs-C/bison/mybison - -25%
MultiSource/Benchmarks/BitBench/uuencode/uuencode - -22%
MultiSource/Applications/d/make_dparser - -14%
SingleSource/Benchmarks/Shootout-C++/ary - -13%

In light of these slowdowns, additional profiling work is obviously needed!

llvm-svn: 158223
2012-06-08 19:19:53 +00:00
Johnny Chen 6ea4c8ea26 rdar://problem/11487457
Previous fix to add convenience registers for x86_64 did not take the 'process attach' scenario into account.
This patch fixes that.

llvm-svn: 158222
2012-06-08 19:06:28 +00:00
Hal Finkel 3d32ad3a7f Mark the PPC CTRRC and CTRRC8 register classes as non-allocatable.
Marking these classes as non-alocatable allows CTR loop generation to
work correctly with the block placement passes, etc. These register
classes are currently used only by some unused TCRETURN patterns.
In future cleanup, these will be removed.

Thanks again to Jakob for suggesting this fix to the CTR loop problem!

llvm-svn: 158221
2012-06-08 19:02:08 +00:00
Manman Ren 6bc2d27073 Enable optimization for integer ABS on X86 if Subtarget has CMOV.
llvm-svn: 158220
2012-06-08 18:58:26 +00:00
Anna Zaks 528b14c5d9 [analyzer] MallocSizeofChecker false positive: when sizeof is argument
to addition.

We should not to warn in case the malloc size argument is an
addition containing 'sizeof' operator - it is common to use the pattern
to pack values of different sizes into a buffer. 

Ex:

uint8_t *buffer = (uint8_t*)malloc(dataSize + sizeof(length));

llvm-svn: 158219
2012-06-08 18:44:43 +00:00
Manman Ren bf86b295bb Test case for r158160
llvm-svn: 158218
2012-06-08 18:42:37 +00:00
Andrew Trick 8cf028752f Sched itinerary fix: Avoid static initializers.
This fixes an accidental dependence on static initialization order that I introduced yesterday.

Thank you Lang!!!

llvm-svn: 158215
2012-06-08 18:25:47 +00:00
Jordan Rose de1a29277e Disable _Pragma during HTML macro rewriting to keep from crashing.
The preprocessor's handling of diagnostic push/pops is stateful, so
encountering pragmas during a re-parse causes problems. HTMLRewrite
already filters out normal # directives including #pragma, so it's
clear it's not expected to be interpreting pragmas in this mode.

This fix adds a flag to Preprocessor to explicitly disable pragmas.
The "right" fix might be to separate pragma lexing from pragma
parsing so that we can throw away pragmas like we do preprocessor
directives, but right now it's important to get the fix in.

Note that this has nothing to do with the "hack" of re-using the
input preprocessor in HTMLRewrite. Even if we someday copy the
preprocessor instead of re-using it, the copy would (and should) include
the diagnostic level tables and have the same problems.

llvm-svn: 158214
2012-06-08 18:06:21 +00:00
Chad Rosier 3d464d8068 Fix a crash in APInt::lshr when shiftAmt > BitWidth.
Patch by James Benton <jbenton@vmware.com>.

llvm-svn: 158213
2012-06-08 18:04:52 +00:00
Andrew Trick 596af1b02e Fix Target->Codegen dependence.
Bulk move of TargetInstrInfo implementation into
TargetInstrInfoImpl. This is dirty because the code isn't part of
TargetInstrInfoImpl class, nor should it be, because the methods are
not target hooks. However, it's the current mechanism for keeping
libTarget useful outside the backend. You'll get a not-so-nice link
error if you invoke a TargetInstrInfo method that depends on CodeGen.

The TargetInstrInfoImpl class should probably be removed since it
doesn't really solve this problem.

To really fix this, we probably need separate interfaces for the
CodeGen/nonCodeGen sides of TargetInstrInfo.

llvm-svn: 158212
2012-06-08 17:23:27 +00:00
Douglas Gregor 02c2dbf45e Switch LineTableInfo to use FileID instead of int for file references,
from Tom Honermann!

llvm-svn: 158211
2012-06-08 16:40:28 +00:00
Nuno Lopes 4b68c1da54 BoundsChecking: add support for ConstantPointerNull. fixes a bunch of instrumentation failures in loops with reallocs
llvm-svn: 158210
2012-06-08 16:31:42 +00:00
NAKAMURA Takumi 5412cef77d test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since r157911.
llvm-svn: 158209
2012-06-08 16:28:06 +00:00
Filipe Cabecinhas 89d91fcf1d Fixed TestCompletion, broken by r158173
llvm-svn: 158207
2012-06-08 16:16:19 +00:00
Hal Finkel 821e00121c Disable the PPC CTR-Loops pass by default.
The pass itself works well, but the something in the Machine* infrastructure
does not understand terminators which define registers. Without the ability
to use the block-placement pass, etc. this causes performance regressions (and
so is turned off by default). Turning off the analysis turns off the problems
with the Machine* infrastructure.

llvm-svn: 158206
2012-06-08 15:38:25 +00:00
Hal Finkel 8b01503ee5 Fix a bug in the new PPC CTR-Loops pass.
The code which tests for an induction operation cannot assume that any
ADDI instruction will have a register operand because the operand could
also be a frame index; for example:
    %vreg16<def> = ADDI8 <fi#0>, 0; G8RC:%vreg16

llvm-svn: 158205
2012-06-08 15:38:23 +00:00
Hal Finkel 96c2d4d945 Add the PPCCTRLoops pass: a PPC machine-code-level optimization pass to form CTR-based loop branching code.
This pass is derived from the Hexagon HardwareLoops pass. The only significant enhancement over the Hexagon
pass is that PPCCTRLoops will also attempt to delete the replaced add and compare operations if they are
no longer otherwise used. Also, invalid preheader DebugLoc is not used.

llvm-svn: 158204
2012-06-08 15:38:21 +00:00
Alexey Samsonov 59036d2c06 [Sanitizer] add internal_memset and internal_strrchr to sanitizer_common/
llvm-svn: 158202
2012-06-08 14:11:12 +00:00
Alexey Samsonov 99d58521c5 [ASan] allow calls to memmove during rtl initialization
llvm-svn: 158201
2012-06-08 14:04:04 +00:00
Alexey Samsonov 6cfc34ea7f [TSan] s/internal_memset/real_memset
llvm-svn: 158200
2012-06-08 13:59:39 +00:00
Duncan Sands 9a5cf92250 Revert commit 158073 while waiting for a fix. The issue is that reassociate
can move instructions within the instruction list.  If the instruction just
happens to be the one the basic block iterator is pointing to, and it is
moved to a different basic block, then we get into an infinite loop due to
the iterator running off the end of the basic block (for some reason this
doesn't fire any assertions).  Original commit message:

Grab-bag of reassociate tweaks.  Unify handling of dead instructions and
instructions to reoptimize.  Exploit this to more systematically eliminate
dead instructions (this isn't very useful in practice but is convenient for
analysing some testcase I am working on).  No need for WeakVH any more: use
an AssertingVH instead.

llvm-svn: 158199
2012-06-08 13:37:30 +00:00
Alexey Samsonov f26b842ca8 [ASan] add interceptor for strncat
llvm-svn: 158198
2012-06-08 13:27:46 +00:00
Tobias Grosser b32ad40188 cmake: Pass the -m32 flag to modules if LLVM_BUILD_32_BITS is enabled
This was previously only done for executables and shared libraries, but not
for modules. As modules are essentially shared libraries (that need to be
dlopened explicitly), threating them the same as shared libraries seems
reasonable. This fixes the LLVM_BUILD_32_BITS build of Polly.

Contributed by: Ondra Hosek  <ondra.hosek@gmail.com>

llvm-svn: 158195
2012-06-08 09:41:23 +00:00
Argyrios Kyrtzidis 1416e17c89 [libclang] Don't crash when saving a PCH from a prefix header
that does not exist.

rdar://11607033

llvm-svn: 158193
2012-06-08 05:48:06 +00:00
Argyrios Kyrtzidis bce6d51a4b [libclang] Add a triple to test/Index/index-decls.m
llvm-svn: 158192
2012-06-08 03:54:16 +00:00
Jason Molenda 64f20ed5a1 Remove empty line at end.
llvm-svn: 158191
2012-06-08 03:38:53 +00:00
Jason Molenda e66b45df8d Add a simple man page for lldb.
llvm-svn: 158190
2012-06-08 03:34:09 +00:00
Argyrios Kyrtzidis 31afb956ae [libclang/AST]
AST: For auto-synthesized ivars give them the location of the related
property (previously they had no source location). This allows them
to be indexed by libclang.

libclang: Make sure synthesized ivars are indexed before the methods that
may reference them.

Fixes rdar://11607001.

llvm-svn: 158189
2012-06-08 02:16:11 +00:00
Sean Callanan 5677536bff Committed a change to the SectionList that introduces
a cache of address ranges for child sections,
accelerating lookups.  This cache is built during
object file loading, and is then set in stone once
the object files are done loading.  (In Debug builds,
we ensure that the cache is never invalidated after
that.)

llvm-svn: 158188
2012-06-08 02:16:08 +00:00
Anna Zaks d60367b893 [analyzer] Use "issue hash" in CmpRuns; followup on r158180
(For the future: It would be more efficient to produce a hash key with
the embedded function info inside the compiler.)

llvm-svn: 158187
2012-06-08 01:50:49 +00:00
Richard Smith 337a5a1c3f Allow friend declarations of defaulted special member functions. Only
definitions of such members are prohibited, not mere declarations.

llvm-svn: 158186
2012-06-08 01:30:54 +00:00
Kaelyn Uhrain 055e9479eb Fix up the 'typename' suggestion logic introduced in r157085, based on
feedback from Doug Gregor.

llvm-svn: 158185
2012-06-08 01:07:26 +00:00
Richard Smith f76568591c PR13047: Fix various abuses of clang::Type in the MS mangler, to make it work
in the presence of type sugar.

llvm-svn: 158184
2012-06-08 00:37:04 +00:00
Owen Anderson da6bd3e603 Teach the AsmMatcherEmitter to allow InstAlias' where the suboperands of a complex operand are called out explicitly in the asm string.
llvm-svn: 158183
2012-06-08 00:25:03 +00:00
Douglas Gregor aadbfafcd1 Fix typo "CursorKind.CONDITONAL_OPERATOR" in Python bindings, from
Manish Verma!

llvm-svn: 158182
2012-06-08 00:16:27 +00:00
Chandler Carruth 392357eea0 Rename a test case to a more generic name. This is a completely useless
test, but David Sehr is looking at spiffing it up and adding some proper
tests for our alloca codegen.

llvm-svn: 158181
2012-06-08 00:06:56 +00:00
Anna Zaks b60908db3a [analyzer] Add experimental "issue hash" to the plist diagnostic.
CmpRuns.py can be used to compare issues from different analyzer runs.
Since it uses the issue line number to unique 2 issues, adding a new
line to the beginning of a file makes all issues in the file reported as
new. 

The hash will be an opaque value which could be used (along with the
function name) by CmpRuns to identify the same issues. This way, we only
fail to identify the same issue from two runs if the function it appears
in changes (not perfect, but much better than nothing).

llvm-svn: 158180
2012-06-08 00:04:43 +00:00
Anna Zaks 93205d0d12 [analyze] Change some of the malloc tests to use clang_analyzer_eval.
Thanks, Jordan.

llvm-svn: 158179
2012-06-08 00:04:40 +00:00
Kaelyn Uhrain 1dac08da4b Teach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.

llvm-svn: 158178
2012-06-07 23:57:12 +00:00
Kaelyn Uhrain 389e9c2d7c Ignore corrections to functions with bodies when deciding which
correction to use for an invalid function redeclaration.

llvm-svn: 158177
2012-06-07 23:57:08 +00:00
Michael J. Spencer aeb59e1d0d [CMake] Promote extension warnings to errors.
llvm-svn: 158176
2012-06-07 23:33:56 +00:00
Manman Ren 2cdc8afccf X86: optimize generated code for integer ABS
This patch will generate the following for integer ABS:
      movl    %edi, %eax
      negl    %eax
      cmovll  %edi, %eax
INSTEAD OF
      movl    %edi, %ecx
      sarl    $31, %ecx
      leal    (%rdi,%rcx), %eax
      xorl    %ecx, %eax

There exists a target-independent DAG combine for integer ABS, which converts
integer ABS to sar+add+xor. For X86, we match this pattern back to neg+cmov. 
This is implemented in PerformXorCombine.

rdar://10695237

llvm-svn: 158175
2012-06-07 22:39:10 +00:00
Douglas Gregor cb8cf4916f Minor comments and changes to clang-completion-mode.el, from David Wood!
llvm-svn: 158174
2012-06-07 22:33:29 +00:00
Sean Callanan 64c0cf2134 Added a setting (target.process.disable-memory-cache)
that controls whether memory is cached.  This is off
by default (i.e., memory is cached) because it greatly
improves performance.

llvm-svn: 158173
2012-06-07 22:26:42 +00:00
Douglas Gregor 07db340438 Fix warning flags for CMake builds, from Andrew C. Morrow!
llvm-svn: 158172
2012-06-07 22:26:00 +00:00
Michael J. Spencer 08180c325f [CMake] Order MSVC warnings numerically.
llvm-svn: 158171
2012-06-07 21:34:31 +00:00
Michael J. Spencer 6d45d834a7 [CMake] Adjust MSVC warnings.
Remove /Wall from LLVM_ENABLE_WARNINGS (it's useless) and promote 4239
to a level 1 warning.

llvm-svn: 158170
2012-06-07 21:34:15 +00:00
Nadav Rotem bbd40f67d8 Do not optimize the used bits of the x86 vselect condition operand, when the condition operand is a vector of 1-bit predicates.
This may happen on MIC devices.

llvm-svn: 158168
2012-06-07 20:53:48 +00:00
Nadav Rotem 4e50efead6 Fix a bug in FoldSelectOpOp. Bitcast ops may change the number of vector elements, which may disagree with the select condition type.
llvm-svn: 158166
2012-06-07 20:28:57 +00:00