platform/upstream/llvm.git
11 years agoRemove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
Richard Smith [Thu, 1 Nov 2012 03:48:49 +0000 (03:48 +0000)]
Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).

llvm-svn: 167210

11 years agoCleanup another place redundant SP maintained
Michael Liao [Thu, 1 Nov 2012 03:47:50 +0000 (03:47 +0000)]
Cleanup another place redundant SP maintained

llvm-svn: 167209

11 years ago[CMake] Add llvm-mcmarkup to check-llvm.
NAKAMURA Takumi [Thu, 1 Nov 2012 02:13:50 +0000 (02:13 +0000)]
[CMake] Add llvm-mcmarkup to check-llvm.

llvm-svn: 167208

11 years agotest/CodeGen/X86/fp-fast.ll: Add +avx.
NAKAMURA Takumi [Thu, 1 Nov 2012 02:13:45 +0000 (02:13 +0000)]
test/CodeGen/X86/fp-fast.ll: Add +avx.

llvm-svn: 167207

11 years agoFix an error message in debugserver so it doesn't print "Unable to
Jason Molenda [Thu, 1 Nov 2012 02:02:59 +0000 (02:02 +0000)]
Fix an error message in debugserver so it doesn't print "Unable to
launch process (null)" because we changed argv while doing argument
parsing.

llvm-svn: 167202

11 years ago[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
Argyrios Kyrtzidis [Thu, 1 Nov 2012 02:01:34 +0000 (02:01 +0000)]
[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

llvm-svn: 167201

11 years agoAdd a few more simple fast-math constant propagations and cancellations.
Owen Anderson [Thu, 1 Nov 2012 02:00:53 +0000 (02:00 +0000)]
Add a few more simple fast-math constant propagations and cancellations.

llvm-svn: 167200

11 years agoclang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease...
NAKAMURA Takumi [Thu, 1 Nov 2012 01:47:02 +0000 (01:47 +0000)]
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease msvc.

llvm-svn: 167199

11 years agoExploit the new identity composition in composeSubRegIndices().
Jakob Stoklund Olesen [Thu, 1 Nov 2012 01:15:43 +0000 (01:15 +0000)]
Exploit the new identity composition in composeSubRegIndices().

The static compose() function in RegisterCoalescer was doing the exact
same thing.

llvm-svn: 167198

11 years agoThere seems to be some odd corner case where we shut down the ProcessGDBRemote, but...
Jim Ingham [Thu, 1 Nov 2012 01:15:33 +0000 (01:15 +0000)]
There seems to be some odd corner case where we shut down the ProcessGDBRemote, but we haven't managed to shut down the async thread.  That causes the ProcessGDBRemote::AsyncThread to crash when it wakes up.  So I changed StartAsyncThread and StopAsyncThread to be callable multiple times (only the first one does anything) so that we can just shut it down unequivocally in the ProcessGDBRemote destructor.

<rdar://problem/12602981>

llvm-svn: 167197

11 years agoDon't insert and erase load instruction. Simply create (new) and delete it.
Jakub Staszak [Thu, 1 Nov 2012 01:10:43 +0000 (01:10 +0000)]
Don't insert and erase load instruction. Simply create (new) and delete it.

llvm-svn: 167196

11 years ago[analyzer] Optimize assumeDual by assuming constraint managers are consistent.
Jordan Rose [Thu, 1 Nov 2012 01:05:39 +0000 (01:05 +0000)]
[analyzer] Optimize assumeDual by assuming constraint managers are consistent.

Specifically, if adding a constraint makes the current system infeasible,
assume the constraint is false, instead of attempting to add its negation.

In +Asserts builds we will still assert that at least one state is feasible.

Patch by Ryan Govostes!

llvm-svn: 167195

11 years agoSwitch from using KERN_PROCARGS2 to get the path to the executed process to proc_pidp...
Jim Ingham [Thu, 1 Nov 2012 01:04:46 +0000 (01:04 +0000)]
Switch from using KERN_PROCARGS2 to get the path to the executed process to proc_pidpath.  The former was flakey, and the whole point of libproc is to protect us from potential flakiness at that level...

<rdar://problem/12594781>

llvm-svn: 167194

11 years ago[lit] For the "case-insensitive-filesystem" make sure to create the test temporary...
Argyrios Kyrtzidis [Thu, 1 Nov 2012 00:59:15 +0000 (00:59 +0000)]
[lit] For the "case-insensitive-filesystem" make sure to create the test temporary file
in the test output directory.

llvm-svn: 167193

11 years agoStreamlined memory manager hierarchy for MCJIT and RuntimeDyld.
Andrew Kaylor [Thu, 1 Nov 2012 00:46:04 +0000 (00:46 +0000)]
Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.

Patch by Ashok Thirumurthi

llvm-svn: 167192

11 years ago[Support] Fix StrError on Windows to actually return the error string...
Michael J. Spencer [Thu, 1 Nov 2012 00:34:09 +0000 (00:34 +0000)]
[Support] Fix StrError on Windows to actually return the error string...

llvm-svn: 167191

11 years agoGenerate a table-driven version of TRI::composeSubRegIndices().
Jakob Stoklund Olesen [Thu, 1 Nov 2012 00:32:10 +0000 (00:32 +0000)]
Generate a table-driven version of TRI::composeSubRegIndices().

Explicitly allow composition of null sub-register indices, and handle
that common case in an inlinable stub.

Use a compressed table implementation instead of the previous nested
switches which generated pretty bad code.

llvm-svn: 167190

11 years ago[analyzer] Fix typo in r167186.
Jordan Rose [Thu, 1 Nov 2012 00:25:15 +0000 (00:25 +0000)]
[analyzer] Fix typo in r167186.

llvm-svn: 167189

11 years agoclang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.
NAKAMURA Takumi [Thu, 1 Nov 2012 00:20:00 +0000 (00:20 +0000)]
clang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.

llvm-svn: 167188

11 years ago[analyzer] Minor cleanup in SimpleStreamChecker's class definition.
Jordan Rose [Thu, 1 Nov 2012 00:18:41 +0000 (00:18 +0000)]
[analyzer] Minor cleanup in SimpleStreamChecker's class definition.

No functionality change.

llvm-svn: 167187

11 years ago[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.
Jordan Rose [Thu, 1 Nov 2012 00:18:27 +0000 (00:18 +0000)]
[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.

(and the same for isFalse)

No functionality change.

llvm-svn: 167186

11 years agoFixed format strings to avoid pointer truncation during 64-bit debugging.
Andrew Kaylor [Thu, 1 Nov 2012 00:17:11 +0000 (00:17 +0000)]
Fixed format strings to avoid pointer truncation during 64-bit debugging.

llvm-svn: 167185

11 years agoCorrectly reject gotos in function-level try blocks. PR14225.
Eli Friedman [Wed, 31 Oct 2012 23:55:28 +0000 (23:55 +0000)]
Correctly reject gotos in function-level try blocks.  PR14225.

llvm-svn: 167184

11 years agoAdded the plists to the debugserver project and fixed the labels for the new plists.
Greg Clayton [Wed, 31 Oct 2012 23:49:14 +0000 (23:49 +0000)]
Added the plists to the debugserver project and fixed the labels for the new plists.

llvm-svn: 167183

11 years agoMore launchd style plists.
Greg Clayton [Wed, 31 Oct 2012 23:43:37 +0000 (23:43 +0000)]
More launchd style plists.

llvm-svn: 167182

11 years agoMC: Simple example parser for MC assembly markup.
Jim Grosbach [Wed, 31 Oct 2012 23:24:13 +0000 (23:24 +0000)]
MC: Simple example parser for MC assembly markup.

Nothing fancy, just a simple demonstration parser.

llvm-svn: 167181

11 years ago(For X86) Enhancement to add-carray/sub-borrow (adc/sbb) optimization.
Shuxin Yang [Wed, 31 Oct 2012 23:11:48 +0000 (23:11 +0000)]
(For X86) Enhancement to add-carray/sub-borrow (adc/sbb) optimization.

  The adc/sbb optimization is to able to convert following expression
into a single adc/sbb instruction:
  (ult) ... = x + 1 // where the ult is unsigned-less-than comparison
  (ult) ... = x - 1

  This change is to flip the "x >u y" (i.e. ugt comparison) in order
to expose the adc/sbb opportunity.

llvm-svn: 167180

11 years agoUse libxml2 on Mac OS X.
Filipe Cabecinhas [Wed, 31 Oct 2012 23:02:00 +0000 (23:02 +0000)]
Use libxml2 on Mac OS X.

llvm-svn: 167179

11 years ago[analyzer] Fix a bug in SimpleStreamChecker - return after sink.
Anna Zaks [Wed, 31 Oct 2012 22:17:48 +0000 (22:17 +0000)]
[analyzer] Fix a bug in SimpleStreamChecker - return after sink.

Thanks Ted.

llvm-svn: 167176

11 years agoResolve any bundle paths we are given when the specified executable is a bundle.
Greg Clayton [Wed, 31 Oct 2012 21:44:39 +0000 (21:44 +0000)]
Resolve any bundle paths we are given when the specified executable is a bundle.

llvm-svn: 167175

11 years agoLoopVectorize: Preserve NSW, NUW and IsExact flags.
Nadav Rotem [Wed, 31 Oct 2012 21:40:39 +0000 (21:40 +0000)]
LoopVectorize: Preserve NSW, NUW and IsExact flags.

llvm-svn: 167174

11 years ago[driver] Remove an extra space with the -iprefix option, so that
Chad Rosier [Wed, 31 Oct 2012 21:08:30 +0000 (21:08 +0000)]
[driver] Remove an extra space with the -iprefix option, so that
matching works correctly.
Part of rdar://12329974

llvm-svn: 167173

11 years ago[PCH] Remove the stat cache from the PCH file.
Argyrios Kyrtzidis [Wed, 31 Oct 2012 20:59:50 +0000 (20:59 +0000)]
[PCH] Remove the stat cache from the PCH file.

The stat cache became essentially useless ever since we started
validating all file entries in the PCH.
But the motivating reason for removing it now is that it also affected
correctness in this situation:

-You have a header without include guards (using "#pragma once" or #import)
-When creating the PCH:
  -The same header is referenced in an #include with different filename cases.
  -In the PCH, of course, we record only one file entry for the header file
  -But we cache in the PCH file the stat info for both filename cases

-Then the source files are updated and the header file is updated in a way that
 its size and modification time are the same but its inode changes

-When using the PCH:
  -We validate the headers, we check that header file and we create a file entry with its current inode
  -There's another #include with a filename with different case than the previously created file entry
  -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode
  -because of the different inodes, we think they are different files so we go ahead and include its contents.

Removing the stat cache will potentially break clients that are attempting to use the stat cache
as a way of avoiding having the actual input files available. If that use case is important, patches are welcome
to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with
literal strings, line/column computations, etc.).

This fixes rdar://5502805

llvm-svn: 167172

11 years agoMore fixes from MSVC warnings found by Carlo Kok.
Greg Clayton [Wed, 31 Oct 2012 20:56:43 +0000 (20:56 +0000)]
More fixes from MSVC warnings found by Carlo Kok.

llvm-svn: 167171

11 years agoFix a bug in the cost calculation of vector casts. Detect situations where bitcasts...
Nadav Rotem [Wed, 31 Oct 2012 20:52:26 +0000 (20:52 +0000)]
Fix a bug in the cost calculation of vector casts. Detect situations where bitcasts cost zero.

llvm-svn: 167170

11 years agoCarlo Kok was compiling with MSVC, caught some more issues.
Greg Clayton [Wed, 31 Oct 2012 20:51:31 +0000 (20:51 +0000)]
Carlo Kok was compiling with MSVC, caught some more issues.

llvm-svn: 167168

11 years agoCarlo Kok found an issue where default parameters were causing the wrong argument...
Greg Clayton [Wed, 31 Oct 2012 20:49:04 +0000 (20:49 +0000)]
Carlo Kok found an issue where default parameters were causing the wrong argument to be passed. I got rid of the default args so we don't run into this.

llvm-svn: 167167

11 years agoFix cl brokeness.
Michael J. Spencer [Wed, 31 Oct 2012 20:47:30 +0000 (20:47 +0000)]
Fix cl brokeness.

cl is not attempting to complete a templated class when used in this
context. The conversion forces this to happen.

Thanks to Richard Smith for figuring this out.

llvm-svn: 167166

11 years agoAdd missing include.
Michael J. Spencer [Wed, 31 Oct 2012 20:47:11 +0000 (20:47 +0000)]
Add missing include.

llvm-svn: 167165

11 years agoMark code, not data, as executable in lli RemoteTarget simulator.
Andrew Kaylor [Wed, 31 Oct 2012 20:37:14 +0000 (20:37 +0000)]
Mark code, not data, as executable in lli RemoteTarget simulator.

llvm-svn: 167164

11 years ago[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to...
Michael Gottesman [Wed, 31 Oct 2012 20:20:04 +0000 (20:20 +0000)]
[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to ensure it only runs on ppc64.

llvm-svn: 167162

11 years ago[driver] Remove an extra space with the -internal-externc-isystem option, so
Chad Rosier [Wed, 31 Oct 2012 19:28:55 +0000 (19:28 +0000)]
[driver] Remove an extra space with the -internal-externc-isystem option, so
that matching works correctly.
Part of rdar://12329974

llvm-svn: 167161

11 years agoPatch for issue found by Carlo Kok. Fixed a type issue where an ';' was incorrectly...
Greg Clayton [Wed, 31 Oct 2012 19:05:35 +0000 (19:05 +0000)]
Patch for issue found by Carlo Kok. Fixed a type issue where an ';' was incorrectly following an if statement. There actually isn't a need for the if statement, so it was removed.

llvm-svn: 167160

11 years agoARM AAPCS-VFP: fix tracking of allocated VFP registers.
Manman Ren [Wed, 31 Oct 2012 19:02:26 +0000 (19:02 +0000)]
ARM AAPCS-VFP: fix tracking of allocated VFP registers.

According to the spec, we can backfill VFP registers that were skipped due
to alignment constraints.

llvm-svn: 167159

11 years ago[driver] Remove the -ccc-host-triple alias. This has been replaced by the
Chad Rosier [Wed, 31 Oct 2012 18:59:38 +0000 (18:59 +0000)]
[driver] Remove the -ccc-host-triple alias.  This has been replaced by the
-target option.
rdar://10692880

llvm-svn: 167158

11 years agoRemove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.
Rafael Espindola [Wed, 31 Oct 2012 18:52:25 +0000 (18:52 +0000)]
Remove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.

llvm-svn: 167157

11 years agogetArchTypeForDarwinArchName is only used in the clang driver, copy it there.
Rafael Espindola [Wed, 31 Oct 2012 18:51:07 +0000 (18:51 +0000)]
getArchTypeForDarwinArchName is only used in the clang driver, copy it there.
I will remove it from llvm in the next commit.

llvm-svn: 167156

11 years agoFix for -ast-dump-filter
Alexander Kornienko [Wed, 31 Oct 2012 18:46:31 +0000 (18:46 +0000)]
Fix for -ast-dump-filter

Summary:
-ast-dump-filter implementation used to stop AST traversal after traversing a NULL Decl node.

Added test and fixed.

Reviewers: djasper, klimek, rsmith

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D93

llvm-svn: 167155

11 years ago[mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
Akira Hatanaka [Wed, 31 Oct 2012 18:37:55 +0000 (18:37 +0000)]
[mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
re-materialization of immediate loads.

llvm-svn: 167153

11 years ago[driver] Completely rework how superfluous options are stripped out of the crash
Chad Rosier [Wed, 31 Oct 2012 18:31:33 +0000 (18:31 +0000)]
[driver] Completely rework how superfluous options are stripped out of the crash
diagnostics script.

This addresses the FIXME pertaining to quoted arguments.  We also delineate
between those flags that have an argument (e.g., -D macro, -MF file) and
those that do not (e.g., -M, -MM, -MG).  Finally, we add the -dwarf-debug-flags
to the list of flags to be removed.
rdar://12329974

llvm-svn: 167152

11 years agoAdd "static" to some functions in altivec.c where it was missing.
Ulrich Weigand [Wed, 31 Oct 2012 18:17:07 +0000 (18:17 +0000)]
Add "static" to some functions in altivec.c where it was missing.

llvm-svn: 167148

11 years agoMCJIT unit test: add calls to ensure that instruction caches are properly invalidated...
Amara Emerson [Wed, 31 Oct 2012 17:44:16 +0000 (17:44 +0000)]
MCJIT unit test: add calls to ensure that instruction caches are properly invalidated before code execution.

llvm-svn: 167146

11 years agoPort lli bug fix from r166920 to MCJIT unit test.
Amara Emerson [Wed, 31 Oct 2012 17:41:51 +0000 (17:41 +0000)]
Port lli bug fix from r166920 to MCJIT unit test.

llvm-svn: 167145

11 years agoCommit access test.
Amara Emerson [Wed, 31 Oct 2012 17:35:12 +0000 (17:35 +0000)]
Commit access test.

llvm-svn: 167144

11 years agoThis patch removes the XFAIL for powerpc for
Bill Schmidt [Wed, 31 Oct 2012 17:31:46 +0000 (17:31 +0000)]
This patch removes the XFAIL for powerpc for
test/CodeGenCXX/member-alignment.cpp.  The test succeeds for
powerpc64-unknown-linux-gnu.  If other flavors of powerpc are
shown by buildbots to still be broken, we can adjust the test
at that time.

llvm-svn: 167143

11 years agoIf skipping bodies is enabled outside code-completion, just skip the body directly
Argyrios Kyrtzidis [Wed, 31 Oct 2012 17:29:28 +0000 (17:29 +0000)]
If skipping bodies is enabled outside code-completion, just skip the body directly
without using tentative parsing.

llvm-svn: 167142

11 years agoDecouple code-completion for the SkipFunctionBodies frontend option and
Argyrios Kyrtzidis [Wed, 31 Oct 2012 17:29:22 +0000 (17:29 +0000)]
Decouple code-completion for the SkipFunctionBodies frontend option and
add a test to make sure code-completion skips bodies.

llvm-svn: 167141

11 years agoRemove stale documentation about tail duplicaton IR pass
Arnold Schwaighofer [Wed, 31 Oct 2012 17:25:31 +0000 (17:25 +0000)]
Remove stale documentation about tail duplicaton IR pass

We no longer have a tail duplication pass that runs on LLVM IR. It was removed
in 3.0.

llvm-svn: 167140

11 years agoTest case for r167039. Check that tail-call optimization is disabled for
Akira Hatanaka [Wed, 31 Oct 2012 17:25:23 +0000 (17:25 +0000)]
Test case for r167039. Check that tail-call optimization is disabled for
mips16.

llvm-svn: 167139

11 years ago[analyzer] Let ConstraintManager subclasses provide a more efficient checkNull.
Jordan Rose [Wed, 31 Oct 2012 16:44:55 +0000 (16:44 +0000)]
[analyzer] Let ConstraintManager subclasses provide a more efficient checkNull.

Previously, every call to a ConstraintManager's isNull would do a full
assumeDual to test feasibility. Now, ConstraintManagers can override
checkNull if they have a cheaper way to do the same thing.
RangeConstraintManager can do this in less than half the work.

<rdar://problem/12608209>

llvm-svn: 167138

11 years agoFix typo in CodeGenerator doc
Eli Bendersky [Wed, 31 Oct 2012 16:41:07 +0000 (16:41 +0000)]
Fix typo in CodeGenerator doc

llvm-svn: 167137

11 years agoLCSSA: Try to recover compile time regressions due to SCEV updates.
Benjamin Kramer [Wed, 31 Oct 2012 16:30:03 +0000 (16:30 +0000)]
LCSSA: Try to recover compile time regressions due to SCEV updates.

- Use value handle tricks to communicate use replacements instead of forgetLoop, this is a lot faster.
- Move the "big hammer" out of the main loop so it's not called for every instruction.

This should recover most (if not all) compile time regressions introduced by this code.

llvm-svn: 167136

11 years agoPut the threshold magic number in a variable.
Nadav Rotem [Wed, 31 Oct 2012 16:22:16 +0000 (16:22 +0000)]
Put the threshold magic number in a variable.

llvm-svn: 167134

11 years agoDisable all old-JIT unit tests on PowerPC.
Ulrich Weigand [Wed, 31 Oct 2012 16:18:02 +0000 (16:18 +0000)]
Disable all old-JIT unit tests on PowerPC.

These tests were all failing since the old JIT doesn't work
for PowerPC (any more), and there are no plans to attempt to
fix it again (instead, work focuses on MCJIT).

llvm-svn: 167133

11 years agoRemove fixme about unreachable cases from SwitchToLookupTable
Hans Wennborg [Wed, 31 Oct 2012 16:15:25 +0000 (16:15 +0000)]
Remove fixme about unreachable cases from SwitchToLookupTable

SimplifyCFG will have removed those cases for us.

llvm-svn: 167132

11 years agoRemove enum values since they are not used anymore.
Nadav Rotem [Wed, 31 Oct 2012 16:14:06 +0000 (16:14 +0000)]
Remove enum values since they are not used anymore.

llvm-svn: 167131

11 years agoAddress Duncan's comments on r167121.
Hans Wennborg [Wed, 31 Oct 2012 15:31:09 +0000 (15:31 +0000)]
Address Duncan's comments on r167121.

llvm-svn: 167130

11 years agoBBVectorize: Choose pair ordering to minimize shuffles
Hal Finkel [Wed, 31 Oct 2012 15:17:07 +0000 (15:17 +0000)]
BBVectorize: Choose pair ordering to minimize shuffles

BBVectorize would, except for loads and stores, always fuse instructions
so that the first instruction (in the current source order) would always
represent the low part of the input vectors and the second instruction
would always represent the high part. This lead to too many shuffles
being produced because sometimes the opposite order produces fewer of them.

With this change, BBVectorize tracks the kind of pair connections that form
the DAG of candidate pairs, and uses that information to reorder the pairs to
avoid excess shuffles. Using this information, a future commit will be able
to add VTTI-based shuffle costs to the pair selection procedure. Importantly,
the number of remaining shuffles can now be estimated during pair selection.

There are some trivial instruction reorderings in the test cases, and one
simple additional test where we certainly want to do a reordering to
avoid an unnecessary shuffle.

llvm-svn: 167122

11 years agoAddress Duncan's comments on r167115
Hans Wennborg [Wed, 31 Oct 2012 15:14:39 +0000 (15:14 +0000)]
Address Duncan's comments on r167115

 - Use 0 instead of NULL
 - Helper function for "dyn_cast, else lookup in the constant pool".

llvm-svn: 167121

11 years agoinstcombine: Migrate strto* optimizations
Meador Inge [Wed, 31 Oct 2012 14:58:26 +0000 (14:58 +0000)]
instcombine: Migrate strto* optimizations

This patch migrates the strto* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167119

11 years agoFix if-else braces layout accordingly to the style guide.
Simon Atanasyan [Wed, 31 Oct 2012 14:39:28 +0000 (14:39 +0000)]
Fix if-else braces layout accordingly to the style guide.

llvm-svn: 167118

11 years agoFix false -> NULL conversion from r167115 spotted by Benjamin Kramer.
Hans Wennborg [Wed, 31 Oct 2012 14:36:48 +0000 (14:36 +0000)]
Fix false -> NULL conversion from r167115 spotted by Benjamin Kramer.

llvm-svn: 167117

11 years agoReplace some instances of UniqueVector with SetVector, which is slightly cheaper.
Benjamin Kramer [Wed, 31 Oct 2012 13:45:49 +0000 (13:45 +0000)]
Replace some instances of UniqueVector with SetVector, which is slightly cheaper.

No functionality change.

llvm-svn: 167116

11 years agoDo simple constant propagation in lookup table formation for switches
Hans Wennborg [Wed, 31 Oct 2012 13:42:45 +0000 (13:42 +0000)]
Do simple constant propagation in lookup table formation for switches

By propagating the value for the switch condition, LLVM can now build
lookup tables for code such as:

  switch (x) {
    case 1: return 5;
    case 2: return 42;
    case 3: case 4: case 5:
      return x - 123;
    default:
      return 123;
  }

Given that x is known for each case, "x - 123" becomes a constant for
cases 3, 4, and 5.

llvm-svn: 167115

11 years agoExtend -Bprefix functionality and make it closer to gcc. If the "prefix"
Simon Atanasyan [Wed, 31 Oct 2012 12:01:53 +0000 (12:01 +0000)]
Extend -Bprefix functionality and make it closer to gcc. If the "prefix"
is not a directory, Driver::GetProgramPath() routine does not try to append
the program name as a "path component" to it. It just joins the "prefix" with
the program name and checks the resulting path existence.

The patch reviewed by Rafael Espindola.

llvm-svn: 167114

11 years agoFix a couple of comment typos.
Benjamin Kramer [Wed, 31 Oct 2012 11:25:32 +0000 (11:25 +0000)]
Fix a couple of comment typos.

llvm-svn: 167113

11 years agoLCSSA: Add a workaround for another nasty SCEV cache invalidation issue.
Benjamin Kramer [Wed, 31 Oct 2012 10:01:29 +0000 (10:01 +0000)]
LCSSA: Add a workaround for another nasty SCEV cache invalidation issue.

I'm not entirely happy with this solution, but I don't see a smarter way currently.
Fixes PR14214.

llvm-svn: 167112

11 years agoAdd IRBuilderBase::getIntPtrTy.
Evgeniy Stepanov [Wed, 31 Oct 2012 09:50:01 +0000 (09:50 +0000)]
Add IRBuilderBase::getIntPtrTy.

llvm-svn: 167111

11 years agoDependenceAnalysis: Don't crash if there is no constant operand.
Benjamin Kramer [Wed, 31 Oct 2012 09:20:38 +0000 (09:20 +0000)]
DependenceAnalysis: Don't crash if there is no constant operand.

This makes the code match the comments. Resolves a crash in loop idiom (PR14219).

llvm-svn: 167110

11 years agoAdd support for ARM segment types PT_ARM_ARCHEXT, PT_ARM_EXIDX and PT_ARM_UNWIND.
James Molloy [Wed, 31 Oct 2012 09:10:56 +0000 (09:10 +0000)]
Add support for ARM segment types PT_ARM_ARCHEXT, PT_ARM_EXIDX and PT_ARM_UNWIND.

Patch by Pete Chou!

llvm-svn: 167109

11 years agoAdd support for Cortex-A15 host recognition.
James Molloy [Wed, 31 Oct 2012 09:07:37 +0000 (09:07 +0000)]
Add support for Cortex-A15 host recognition.

No testcase, as this is only testable on a C-A15 board.

llvm-svn: 167108

11 years agoImplement ADJCALLSTACKUP and ADJCALLSTACKDOWN
Reed Kotler [Wed, 31 Oct 2012 05:21:10 +0000 (05:21 +0000)]
Implement ADJCALLSTACKUP and ADJCALLSTACKDOWN

llvm-svn: 167107

11 years agoAdd scalar forms of FMA4 VFNMSUB/VFNMADD to folding tables. Patch from Cameron McInally.
Craig Topper [Wed, 31 Oct 2012 04:59:46 +0000 (04:59 +0000)]
Add scalar forms of FMA4 VFNMSUB/VFNMADD to folding tables. Patch from Cameron McInally.

llvm-svn: 167106

11 years agoinstcombine: Migrate strpbrk optimizations
Meador Inge [Wed, 31 Oct 2012 04:29:58 +0000 (04:29 +0000)]
instcombine: Migrate strpbrk optimizations

This patch migrates the strpbrk optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167105

11 years agoClean up redundant SP register maintained in X86 TLI
Michael Liao [Wed, 31 Oct 2012 04:14:09 +0000 (04:14 +0000)]
Clean up redundant SP register maintained in X86 TLI

llvm-svn: 167104

11 years agoinstcombine: Migrate strlen optimizations
Meador Inge [Wed, 31 Oct 2012 03:33:06 +0000 (03:33 +0000)]
instcombine: Migrate strlen optimizations

This patch migrates the strlen optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167103

11 years agoinstcombine: Migrate strncpy optimizations
Meador Inge [Wed, 31 Oct 2012 03:33:00 +0000 (03:33 +0000)]
instcombine: Migrate strncpy optimizations

This patch migrates the strncpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167102

11 years agoLoopVectorize: Do not vectorize loops with tiny constant trip counts.
Nadav Rotem [Wed, 31 Oct 2012 03:31:07 +0000 (03:31 +0000)]
LoopVectorize: Do not vectorize loops with tiny constant trip counts.

llvm-svn: 167101

11 years agoRemove empty directories.
Rafael Espindola [Wed, 31 Oct 2012 02:34:48 +0000 (02:34 +0000)]
Remove empty directories.

llvm-svn: 167100

11 years ago[analyzer] SimpleStreamChecker - remove evalAssume and other refinements
Anna Zaks [Wed, 31 Oct 2012 02:32:41 +0000 (02:32 +0000)]
[analyzer] SimpleStreamChecker - remove evalAssume and other refinements

llvm-svn: 167099

11 years agoRemove really old benchmark data.
Rafael Espindola [Wed, 31 Oct 2012 02:29:15 +0000 (02:29 +0000)]
Remove really old benchmark data.

llvm-svn: 167098

11 years agoRmoved a duplicate version of SetSelectedThreadByID
Sean Callanan [Wed, 31 Oct 2012 02:12:08 +0000 (02:12 +0000)]
Rmoved a duplicate version of SetSelectedThreadByID
that confused external clients.

<rdar://problem/12599528>

llvm-svn: 167097

11 years agoRemoved some spurious files from our Copy
Sean Callanan [Wed, 31 Oct 2012 02:03:31 +0000 (02:03 +0000)]
Removed some spurious files from our Copy
Headers build phase.

llvm-svn: 167096

11 years agoFixed a crash when we couldn't create a
Sean Callanan [Wed, 31 Oct 2012 02:01:58 +0000 (02:01 +0000)]
Fixed a crash when we couldn't create a
CXXMethodDecl but tried to manipulate it
anyway.

<rdar://problem/12601996>

llvm-svn: 167095

11 years agoFix the bit pattern for vst1 in EmulateInstructionARM::GetThumbOpcodeForInstruction
Jason Molenda [Wed, 31 Oct 2012 02:00:46 +0000 (02:00 +0000)]
Fix the bit pattern for vst1 in EmulateInstructionARM::GetThumbOpcodeForInstruction
so it is recognized correctly.  The second patch needed for <rdar://problem/10652166>.

llvm-svn: 167094

11 years agoRemove the -ccc-no-clang option.
Rafael Espindola [Wed, 31 Oct 2012 01:21:20 +0000 (01:21 +0000)]
Remove the -ccc-no-clang option.

llvm-svn: 167093

11 years ago[analyzer]Don't invalidate const arguments when there is no
Anna Zaks [Wed, 31 Oct 2012 01:18:26 +0000 (01:18 +0000)]
[analyzer]Don't invalidate const arguments when there is no
IdentifierInfo.

Ee: C++ copy constructors.
llvm-svn: 167092

11 years agoAddress Jordan's review: comments, spaces.
Anna Zaks [Wed, 31 Oct 2012 01:18:22 +0000 (01:18 +0000)]
Address Jordan's review: comments, spaces.

llvm-svn: 167091

11 years agoThis patch addresses an ABI compatibility issue with empty aggregate
Bill Schmidt [Wed, 31 Oct 2012 01:15:05 +0000 (01:15 +0000)]
This patch addresses an ABI compatibility issue with empty aggregate
parameters.  Examples of these are:

  struct { } a;
  union { } b[256];
  int a[0];

An empty aggregate has an address, although dereferencing that address is
pointless.  When passed as a parameter, an empty aggregate does not consume
a protocol register, nor does it consume a doubleword in the parameter save
area.  Passing an empty aggregate by reference passes an address just as
for any other aggregate.  Returning an empty aggregate uses GPR3 as a hidden
address of the return value location, just as for any other aggregate.

The patch modifies PPCTargetLowering::LowerFormalArguments_64SVR4 and
PPCTargetLowering::LowerCall_64SVR4 to properly skip empty aggregate
parameters passed by value.  The handling of return values and by-reference
parameters was already correct.

Built on powerpc64-unknown-linux-gnu and tested with no new regressions.
A test case is included to test proper handling of empty aggregate
parameters on both sides of the function call protocol.

llvm-svn: 167090

11 years agoadd test for r167063
Seth Cantrell [Wed, 31 Oct 2012 01:03:35 +0000 (01:03 +0000)]
add test for r167063

llvm-svn: 167089