9 years agoDo not use linkonce_odr linkage in .ll files. This prevented them
Peter Collingbourne [Sun, 5 Aug 2012 22:25:48 +0000 (22:25 +0000)]
Do not use linkonce_odr linkage in .ll files.  This prevented them
from being linked into the library under lazy linkage.

llvm-svn: 161314

9 years agoPTX: move implementations of work-item and synchronisation functions
Peter Collingbourne [Sun, 5 Aug 2012 22:25:37 +0000 (22:25 +0000)]
PTX: move implementations of work-item and synchronisation functions
to lib, and add header files in generic.  Incorporates a patch by
Tom Stellard!

llvm-svn: 161313

9 years agoImplement sub_sat builtin. Patch by Lei Mou!
Peter Collingbourne [Sun, 5 Aug 2012 22:25:12 +0000 (22:25 +0000)]
Implement sub_sat builtin.  Patch by Lei Mou!

llvm-svn: 161312

9 years agoFix declarations of __clc_add_sat_*. Patch by Lei Mou!
Peter Collingbourne [Sun, 5 Aug 2012 22:24:36 +0000 (22:24 +0000)]
Fix declarations of __clc_add_sat_*.  Patch by Lei Mou!

llvm-svn: 161311

9 years agoAdd __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() intrinsic.
Hal Finkel [Sun, 5 Aug 2012 22:03:08 +0000 (22:03 +0000)]
Add __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() intrinsic.

llvm-svn: 161310

9 years agostd::equal operating on non-const __bit_iterators was not working. This fixes it.
Howard Hinnant [Sun, 5 Aug 2012 21:43:11 +0000 (21:43 +0000)]
std::equal operating on non-const __bit_iterators was not working.  This fixes it.

llvm-svn: 161309

9 years agoAndrew Morrow: The current CMake setup for libc++ incorrectly uses the variable
Howard Hinnant [Sun, 5 Aug 2012 17:37:39 +0000 (17:37 +0000)]
Andrew Morrow: The current CMake setup for libc++ incorrectly uses the variable
figuring out what _DEBUG/NDEBUG defines to set. It also tries to test
the non-existent variable 'uppercase_CMAKE_BUILD_TYPE', which the top
level LLVM CMakeLists.txt sets up, but which the top level libc++
CMakeLists.txt currently does not. Changing the variable name tested
and creating the uppercase release name variable allows libc++ to
honor the LIBCXX_ENABLE_ASSERTIONS option correctly.

llvm-svn: 161308

9 years agoUpdate test to check for r161305
Craig Topper [Sun, 5 Aug 2012 09:06:28 +0000 (09:06 +0000)]
Update test to check for r161305

llvm-svn: 161307

9 years agoRemove custom inserter for MWAIT. It doesn't do anything that couldn't be represented...
Craig Topper [Sun, 5 Aug 2012 00:36:57 +0000 (00:36 +0000)]
Remove custom inserter for MWAIT. It doesn't do anything that couldn't be represented in a pattern.

llvm-svn: 161306

9 years agoUse a COPY node instead of an explicit MOVA opcode in the custom insterter for pcmpes...
Craig Topper [Sun, 5 Aug 2012 00:17:48 +0000 (00:17 +0000)]
Use a COPY node instead of an explicit MOVA opcode in the custom insterter for pcmpestrm/pcmpistrm. Allows the register allocator to handle it better and prevent wasted identity moves.

llvm-svn: 161305

9 years agoSimplify code, no functionality change.
Benjamin Kramer [Sat, 4 Aug 2012 17:00:46 +0000 (17:00 +0000)]
Simplify code, no functionality change.

llvm-svn: 161303

9 years agoAdd readcyclecounter lowering on PPC64.
Hal Finkel [Sat, 4 Aug 2012 14:10:46 +0000 (14:10 +0000)]
Add readcyclecounter lowering on PPC64.

On PPC64, this can be done with a simple TableGen pattern.
To enable this, I've added the (otherwise missing) readcyclecounter
SDNode definition to TargetSelectionDAG.td.

llvm-svn: 161302

9 years agoSkip impdef regs during eabi save/restore list emission to workaround PR11902
Anton Korobeynikov [Sat, 4 Aug 2012 13:25:58 +0000 (13:25 +0000)]
Skip impdef regs during eabi save/restore list emission to workaround PR11902

llvm-svn: 161301

9 years agoRecognize vst1.64 / vld1.64 with 3 and 4 regs as load from / store to stack stuff
Anton Korobeynikov [Sat, 4 Aug 2012 13:22:14 +0000 (13:22 +0000)]
Recognize vst1.64 / vld1.64 with 3 and 4 regs as load from / store to stack stuff
(this corresponds by spilling/reloading regs in DTriple / DQuad reg classes).
No testcase, found by inspection.

llvm-svn: 161300

9 years agoAdd stack spill / reload instructions for DTriple and DQuad register classes, which
Anton Korobeynikov [Sat, 4 Aug 2012 13:16:12 +0000 (13:16 +0000)]
Add stack spill / reload instructions for DTriple and DQuad register classes, which
were missed for no reason. This fixes PR13377

llvm-svn: 161299

9 years agoRemove extraneous ';'.
Bill Wendling [Sat, 4 Aug 2012 10:31:40 +0000 (10:31 +0000)]
Remove extraneous ';'.

llvm-svn: 161298

9 years agoUpdate cmake build.
Benjamin Kramer [Sat, 4 Aug 2012 09:52:39 +0000 (09:52 +0000)]
Update cmake build.

llvm-svn: 161297

9 years agoPostpone the deletion of the old name in StructType::setName to allow using a slice...
Benjamin Kramer [Sat, 4 Aug 2012 09:47:02 +0000 (09:47 +0000)]
Postpone the deletion of the old name in StructType::setName to allow using a slice of the old name.

Fixes PR13522. Add a rudimentary unit test to exercise the behavior.

llvm-svn: 161296

9 years ago[CMake] add_lit_target: Remove comments about add_dependencies. It is not a bug in...
NAKAMURA Takumi [Sat, 4 Aug 2012 02:14:44 +0000 (02:14 +0000)]
[CMake] add_lit_target: Remove comments about add_dependencies. It is not a bug in cmake that add_custom_target(DEPENDS) would not accept targets but file-level dependencies.

llvm-svn: 161295

9 years ago[analyzer] Malloc: remove assert since is not valid as of r161248
Anna Zaks [Sat, 4 Aug 2012 02:04:27 +0000 (02:04 +0000)]
[analyzer] Malloc: remove assert since is not valid as of r161248

We can be in the situation where we did not track the symbol before
realloc was called on it.

llvm-svn: 161294

9 years agoPull in cxa_demangle.cpp/.h from llvm's libcxxabi project. Change the namespace...
Johnny Chen [Sat, 4 Aug 2012 01:36:57 +0000 (01:36 +0000)]
Pull in cxa_demangle.cpp/.h from llvm's libcxxabi project.  Change the namespace to lldb_cxxabiv1 for the time being.
Mangled.cpp is not wired in to call it yet.

llvm-svn: 161293

9 years agollc: Try to suppress failures since r161262 .
NAKAMURA Takumi [Sat, 4 Aug 2012 01:29:37 +0000 (01:29 +0000)]
llc: Try to suppress failures since r161262 .

FIXME: Fix several tests on i686-win32 due to lacking of many libraries.
llvm-svn: 161292

9 years agoobjective-C string literal has no side-effect,
Fariborz Jahanian [Sat, 4 Aug 2012 01:24:33 +0000 (01:24 +0000)]
objective-C string literal has no side-effect,
resulting in issuance of unused static variable
warning now. // rdar://10777111

llvm-svn: 161291

9 years ago[analyzer] Use a more robust check for null in CallAndMessageChecker.
Jordan Rose [Sat, 4 Aug 2012 01:04:52 +0000 (01:04 +0000)]
[analyzer] Use a more robust check for null in CallAndMessageChecker.

This should fix the failing test on the buildbot as well.

llvm-svn: 161290

9 years agoLoosen up the timing requirements on 4 more tests.
Howard Hinnant [Sat, 4 Aug 2012 00:47:42 +0000 (00:47 +0000)]
Loosen up the timing requirements on 4 more tests.

llvm-svn: 161289

9 years ago[analyzer] Don't assume values bound to references are automatically non-null.
Jordan Rose [Sat, 4 Aug 2012 00:25:30 +0000 (00:25 +0000)]
[analyzer] Don't assume values bound to references are automatically non-null.

While there is no such thing as a "null reference" in the C++ standard,
many implementations of references (including Clang's) do not actually
check that the location bound to them is non-null. Thus unlike a regular
null dereference, this will not cause a problem at runtime until the
reference is actually used. In order to catch these cases, we need to not
prune out paths on which the input pointer is null.

llvm-svn: 161288

9 years agoFix the name of this variable.
Eric Christopher [Sat, 4 Aug 2012 00:11:22 +0000 (00:11 +0000)]
Fix the name of this variable.

llvm-svn: 161287

9 years agoUpdate comment to accurately reflect what should happen.
Eric Christopher [Sat, 4 Aug 2012 00:11:20 +0000 (00:11 +0000)]
Update comment to accurately reflect what should happen.

llvm-svn: 161286

9 years agoDelete a dead variable.
Jakob Stoklund Olesen [Sat, 4 Aug 2012 00:04:03 +0000 (00:04 +0000)]
Delete a dead variable.

TwoAddressInstructionPass doesn't remat any more.

llvm-svn: 161285

9 years agoTwoAddressInstructionPass refactoring: Extract another method.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 23:57:58 +0000 (23:57 +0000)]
TwoAddressInstructionPass refactoring: Extract another method.

llvm-svn: 161284

9 years ago[analyzer] Update initializer assertion for delegating constructors.
Jordan Rose [Fri, 3 Aug 2012 23:31:15 +0000 (23:31 +0000)]
[analyzer] Update initializer assertion for delegating constructors.

Like base constructors, delegating constructors require no further
processing in the CFGInitializer node.

Also, add PrettyStackTraceLoc to the initializer and destructor logic
so we can get better stack traces in the future.

llvm-svn: 161283

9 years agoRefactor and check "onlyReadsMemory" before optimizing builtins.
Bob Wilson [Fri, 3 Aug 2012 23:29:17 +0000 (23:29 +0000)]
Refactor and check "onlyReadsMemory" before optimizing builtins.

This patch is mostly just refactoring a bunch of copy-and-pasted code, but
it also adds a check that the call instructions are readnone or readonly.
That check was already present for sin, cos, sqrt, log2, and exp2 calls, but
it was missing for the rest of the builtins being handled in this code.

llvm-svn: 161282

9 years agoTwoAddressInstructionPass refactoring: Extract a method.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 23:25:45 +0000 (23:25 +0000)]
TwoAddressInstructionPass refactoring: Extract a method.

No functional change intended, except replacing a DenseMap with a
SmallDenseMap which should behave identically.

llvm-svn: 161281

9 years ago[analyzer] When a symbol is null, we should track its constraints.
Jordan Rose [Fri, 3 Aug 2012 23:09:01 +0000 (23:09 +0000)]
[analyzer] When a symbol is null, we should track its constraints.

Because of this, we would previously emit NO path notes when a parameter
is constrained to null (because there are no stores). Now we show where we
made the assumption, which is much more useful.

llvm-svn: 161280

9 years ago[analyzer] Flatten path diagnostics for text output like we do for HTML.
Jordan Rose [Fri, 3 Aug 2012 23:08:54 +0000 (23:08 +0000)]
[analyzer] Flatten path diagnostics for text output like we do for HTML.

llvm-svn: 161279

9 years ago[analyzer] Track null/uninitialized C++ objects used in method calls.
Jordan Rose [Fri, 3 Aug 2012 23:08:49 +0000 (23:08 +0000)]
[analyzer] Track null/uninitialized C++ objects used in method calls.

llvm-svn: 161278

9 years ago[analyzer] Provide useful PathDiagnosticLocations for CallEnter/Exit events.
Jordan Rose [Fri, 3 Aug 2012 23:08:44 +0000 (23:08 +0000)]
[analyzer] Provide useful PathDiagnosticLocations for CallEnter/Exit events.

llvm-svn: 161277

9 years ago[analyzer] FindLastStoreBRVisitor was not actually finding stores.
Jordan Rose [Fri, 3 Aug 2012 23:08:42 +0000 (23:08 +0000)]
[analyzer] FindLastStoreBRVisitor was not actually finding stores.

The visitor walks back through the ExplodedGraph as expected, but
it wasn't actually keeping track of when a value was assigned. This
meant that it only worked when the value was assigned when the variable
was defined.

Tests in the next commit (dependent on another change).

llvm-svn: 161276

9 years agoEnhance getImplicitObjectArgument to look through ->*.
Jordan Rose [Fri, 3 Aug 2012 23:08:39 +0000 (23:08 +0000)]
Enhance getImplicitObjectArgument to look through ->*.

This only applies in the case where ->* is not overloaded, since it
specifically looks for BinaryOperator and not CXXOperatorCallExpr.

llvm-svn: 161275

9 years ago[analyzer] Add a test for copy-constructor inlining.
Jordan Rose [Fri, 3 Aug 2012 23:08:36 +0000 (23:08 +0000)]
[analyzer] Add a test for copy-constructor inlining.

llvm-svn: 161274

9 years agoBegin adding support for updating LiveIntervals in TwoAddressInstructionPass.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 22:58:34 +0000 (22:58 +0000)]
Begin adding support for updating LiveIntervals in TwoAddressInstructionPass.

This is far from complete, and only changes behavior when the
-early-live-intervals flag is passed to llc.

llvm-svn: 161273

9 years ago1. Redo mips16 instructions to avoid multiple opcodes for same instruction.
Akira Hatanaka [Fri, 3 Aug 2012 22:57:02 +0000 (22:57 +0000)]
1. Redo mips16 instructions to avoid multiple opcodes for same instruction.
Change these to patterns.
2. Add another 16 instructions.

Patch by Reed Kotler.

llvm-svn: 161272

9 years ago<rdar://problem/12027563> Making sure that some class of stop-hook commands that...
Enrico Granata [Fri, 3 Aug 2012 22:24:48 +0000 (22:24 +0000)]
<rdar://problem/12027563> Making sure that some class of stop-hook commands that involve po'ing objects do not cause an endless recursion

llvm-svn: 161271

9 years agoAdd an experimental -early-live-intervals option.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 22:12:54 +0000 (22:12 +0000)]
Add an experimental -early-live-intervals option.

This option runs LiveIntervals before TwoAddressInstructionPass which
will eventually learn to exploit and update the analysis.

Eventually, LiveIntervals will run before PHIElimination, and we can get
rid of LiveVariables.

llvm-svn: 161270

9 years agoDelete merged physreg copies in joinReservedPhysReg().
Jakob Stoklund Olesen [Fri, 3 Aug 2012 22:12:51 +0000 (22:12 +0000)]
Delete merged physreg copies in joinReservedPhysReg().

Previously, the identity copy would survive through register allocation
before it was removed by the rewriter.

llvm-svn: 161269

9 years agoFixes apple: #12020687. This was a problem in the demangler with template
Howard Hinnant [Fri, 3 Aug 2012 22:02:07 +0000 (22:02 +0000)]
Fixes apple:  #12020687.  This was a problem in the demangler with template
substitution forward references.  That is, sometimes a mangled name refers to
a substitution that hasn't yet been defined.  The demangler was derferencing a
null pointer in this case because it wasn't properly guarded against a
forward reference.  Test case added to catch this problem.

llvm-svn: 161267

9 years agoMake property synthesis the default on Windows.
Fariborz Jahanian [Fri, 3 Aug 2012 21:51:38 +0000 (21:51 +0000)]
Make property synthesis the default on Windows.

llvm-svn: 161266

9 years ago[analyzer] Fixup: remove the extra whitespace
Anna Zaks [Fri, 3 Aug 2012 21:49:42 +0000 (21:49 +0000)]
[analyzer] Fixup: remove the extra whitespace

llvm-svn: 161265

9 years ago[analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM
Anna Zaks [Fri, 3 Aug 2012 21:43:37 +0000 (21:43 +0000)]
[analyzer] ObjC Inlining: Start tracking dynamic type info in the GDM

In the following code, find the type of the symbolic receiver by
following it and updating the dynamic type info in the state when we
cast the symbol from id to MyClass *.

  MyClass *a = [[self alloc] init];
  return 5/[a testSelf];

llvm-svn: 161264

9 years agoTry to reduce the compile time impact of r161232.
Bob Wilson [Fri, 3 Aug 2012 21:26:24 +0000 (21:26 +0000)]
Try to reduce the compile time impact of r161232.

The previous change caused fast isel to not attempt handling any calls to
builtin functions.  That included things like "printf" and caused some
noticable regressions in compile time.  I wanted to avoid having fast isel
keep a separate list of functions that had to be kept in sync with what the
code in SelectionDAGBuilder.cpp was handling.  I've resolved that here by
moving the list into TargetLibraryInfo.  This is somewhat redundant in
SelectionDAGBuilder but it will ensure that we keep things consistent.

llvm-svn: 161263

9 years agoFix memcmp code-gen to honor -fno-builtin.
Bob Wilson [Fri, 3 Aug 2012 21:26:18 +0000 (21:26 +0000)]
Fix memcmp code-gen to honor -fno-builtin.

I noticed that SelectionDAGBuilder::visitCall was missing a check for memcmp
in TargetLibraryInfo, so that it would use custom code for memcmp calls even
with -fno-builtin.  I also had to add a new -disable-simplify-libcalls option
to llc so that I could write a test for this.

llvm-svn: 161262

9 years agoComment diagnostics: warn if \returns is used in a non-function comment or if
Dmitri Gribenko [Fri, 3 Aug 2012 21:15:32 +0000 (21:15 +0000)]
Comment diagnostics: warn if \returns is used in a non-function comment or if
the function returns void.

llvm-svn: 161261

9 years agoFix crash if a literal operator template's template parameter pack is not a non-type...
Richard Smith [Fri, 3 Aug 2012 21:14:57 +0000 (21:14 +0000)]
Fix crash if a literal operator template's template parameter pack is not a non-type template parameter pack. Patch by Andy Gibbs!

llvm-svn: 161260

9 years agoCompletely eliminate VNInfo flags.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:59:32 +0000 (20:59 +0000)]
Completely eliminate VNInfo flags.

The 'unused' state of a value number can be represented as an invalid
def SlotIndex. This also exposed code that shouldn't have been looking
at unused value VNInfos.

llvm-svn: 161258

9 years agoFix a couple of loops that were processing unused value numbers.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:59:29 +0000 (20:59 +0000)]
Fix a couple of loops that were processing unused value numbers.

Unused VNInfos should be left alone. Their def SlotIndex doesn't point
to anything.

llvm-svn: 161257

9 years agoSilence unused variable warning in -asserts build
Matt Beaumont-Gay [Fri, 3 Aug 2012 20:54:11 +0000 (20:54 +0000)]
Silence unused variable warning in -asserts build

llvm-svn: 161256

9 years agoEliminate the VNInfo::hasPHIKill() flag.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:19:44 +0000 (20:19 +0000)]
Eliminate the VNInfo::hasPHIKill() flag.

The only real user of the flag was removeCopyByCommutingDef(), and it
has been switched to LiveIntervals::hasPHIKill().

All the code changed by this patch was only concerned with computing and
propagating the flag.

llvm-svn: 161255

9 years agoMake the hasPHIKills flag a computed property.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:10:24 +0000 (20:10 +0000)]
Make the hasPHIKills flag a computed property.

The VNInfo::HAS_PHI_KILL is only half supported. We precompute it in
LiveIntervalAnalysis, but it isn't properly updated by live range
splitting and functions like shrinkToUses().

It is only used in one place: RegisterCoalescer::removeCopyByCommutingDef().

This patch changes that function to use a new LiveIntervals::hasPHIKill()
function that computes the flag for a given value number.

llvm-svn: 161254

9 years agoAdd a configure flag for enabling -Werror on the command line
Eric Christopher [Fri, 3 Aug 2012 19:58:20 +0000 (19:58 +0000)]
Add a configure flag for enabling -Werror on the command line
while building as requested by Lang.

llvm-svn: 161253

9 years agoAdd support for detecting libxml for Dmitri's work. He'll
Eric Christopher [Fri, 3 Aug 2012 19:47:19 +0000 (19:47 +0000)]
Add support for detecting libxml for Dmitri's work. He'll
commit code in clang that uses this shortly.

llvm-svn: 161252

9 years agoAdd a configure option to pass -std=c++11 on the command line.
Eric Christopher [Fri, 3 Aug 2012 19:47:14 +0000 (19:47 +0000)]
Add a configure option to pass -std=c++11 on the command line.


llvm-svn: 161251

9 years agoRemove a dead prototype.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 18:34:32 +0000 (18:34 +0000)]
Remove a dead prototype.

llvm-svn: 161250

9 years ago[analyzer] Fix a typo. Thanks Jordan.
Anna Zaks [Fri, 3 Aug 2012 18:30:20 +0000 (18:30 +0000)]
[analyzer] Fix a typo. Thanks Jordan.

llvm-svn: 161249

9 years ago[analyzer] Malloc: track non-allocated but freed memory
Anna Zaks [Fri, 3 Aug 2012 18:30:18 +0000 (18:30 +0000)]
[analyzer] Malloc: track non-allocated but freed memory

There is no reason why we should not track the memory which was not
allocated in the current function, but was freed there. This would
allow to catch more use-after-free and double free with no/limited IPA.

Also fix a realloc issue which surfaced as the result of this patch.

llvm-svn: 161248

9 years agoPerformance tweaking rotate.
Howard Hinnant [Fri, 3 Aug 2012 18:01:20 +0000 (18:01 +0000)]
Performance tweaking rotate.

rotate is a critical algorithm because it is often used by other algorithms,
both std and non-std.  The main thrust of this optimization is a specialized
algorithm when the 'distance' to be shifted is 1 (either left or right).  To my
surprise, this 'optimization' was not effective for types like std::string.
std::string favors rotate algorithms which only use swap.  But for types like
scalars, and especially when the sequence is random access, these new
specializations are a big win.  If it is a vector<size_t> for example, the
rotate is done via a memmove and can be several times faster than the gcd

I'm using is_trivially_move_assignable to distinguish between types like int and
types like string.  This is obviously an ad-hoc approximation, but I haven't
found a case where it doesn't give good results.

I've used a 'static if' (with is_trivially_move_assignable) in three places.
Testing with both -Os and -O3 showed that clang eliminated all code not be
executed by the 'static if' (including the 'static if' itself).

llvm-svn: 161247

9 years agoRevert previous patch here, we should instead configure in specific
Eric Christopher [Fri, 3 Aug 2012 17:45:31 +0000 (17:45 +0000)]
Revert previous patch here, we should instead configure in specific
packages for particular uses.

llvm-svn: 161246

9 years agoFix line endings.
Michael Han [Fri, 3 Aug 2012 17:40:43 +0000 (17:40 +0000)]
Fix line endings.

llvm-svn: 161245

9 years agoTableGen: Remove extraneous \ character from arm_neon.h definitions.
Jim Grosbach [Fri, 3 Aug 2012 17:30:46 +0000 (17:30 +0000)]
TableGen: Remove extraneous \ character from arm_neon.h definitions.

llvm-svn: 161244

9 years agoFlesh out test for defaulted key functions a bit more.
Benjamin Kramer [Fri, 3 Aug 2012 15:43:22 +0000 (15:43 +0000)]
Flesh out test for defaulted key functions a bit more.

llvm-svn: 161243

9 years agoDelete dead function.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 15:21:21 +0000 (15:21 +0000)]
Delete dead function.

llvm-svn: 161242

9 years agoDon't delete dead code in TwoAddressInstructionPass.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 15:11:57 +0000 (15:11 +0000)]
Don't delete dead code in TwoAddressInstructionPass.

This functionality was added before we started running
DeadMachineInstructionElim on all targets. It serves no purpose now.

llvm-svn: 161241

9 years agoallow 'make CPPFLAGS=<something>' work again
Gabor Greif [Fri, 3 Aug 2012 13:31:24 +0000 (13:31 +0000)]
allow 'make CPPFLAGS=<something>' work again

this makes this hack a bit more bearable
for poor souls who need to pass custom
preprocessor flags to the build process

llvm-svn: 161240

9 years agoAdd preliminary implementation for GPGPU code generation.
Tobias Grosser [Fri, 3 Aug 2012 12:50:07 +0000 (12:50 +0000)]
Add preliminary implementation for GPGPU code generation.

Translate the selected parallel loop body into a ptx string and run it with the
cuda driver API. We limit this preliminary implementation to target the
following special test cases:

  - Support only 2-dimensional parallel loops with or without only one innermost
    non-parallel loop.
  - Support write memory access to only one array in a SCoP.

The patch was committed with smaller changes to the build system:

There is now a flag to enable gpu code generation explictly. This was required
as we need the llvm.codegen() patch applied on the llvm sources, to compile this
feature correctly. Also, enabling gpu code generation does not require cuda.
This requirement was removed to allow 'make polly-test' runs, even without an
installed cuda runtime.

Contributed by:  Yabin Hu  <yabin.hwu@gmail.com>

llvm-svn: 161239

9 years agoReduce temp file pollution in some test cases.
Benjamin Kramer [Fri, 3 Aug 2012 10:35:06 +0000 (10:35 +0000)]
Reduce temp file pollution in some test cases.

llvm-svn: 161237

9 years agoFix failed to generate vtables in certain cases.
Benjamin Kramer [Fri, 3 Aug 2012 08:39:58 +0000 (08:39 +0000)]
Fix failed to generate vtables in certain cases.

By C++ standard, the vtable should be generated if the first non-inline
virtual function is defined in the TU.  Current version of clang doesn't
generate vtable if the first virtual function is defaulted, because the
key function is regarded as the defaulted function.

Patch by Li Kan!

llvm-svn: 161236

9 years agoRemove 'using namespace llvm' from header file
Tobias Grosser [Fri, 3 Aug 2012 08:11:24 +0000 (08:11 +0000)]
Remove 'using namespace llvm' from header file

This fixes a conflict between polly::createIndVarSimplifyPass() and
llvm::createIndVarSimplifyPass(), which causes problems on windows.

Reported by:  Michael Kruse  <MichaelKruse@meinersbur.de

llvm-svn: 161235

9 years agocmake: Fix building of Polly on Apple system
Tobias Grosser [Fri, 3 Aug 2012 07:12:07 +0000 (07:12 +0000)]
cmake: Fix building of Polly on Apple system

The Apple linker fails by default, if some function calls can not be resolved at
link time. However, all functions that are part of LLVM itself will not be
linked into Polly, but will be provided by the compiler that Polly is loaded
into.  Hence, during linking we need to ignore failures due to unresolved
function calls.

llvm-svn: 161234

9 years agoAdd a BUILD_FLAGS variable so that autoconf checks have a place
Eric Christopher [Fri, 3 Aug 2012 05:18:00 +0000 (05:18 +0000)]
Add a BUILD_FLAGS variable so that autoconf checks have a place
to store additional flag options since too many things can
and do override CPPFLAGS. Also, this is exported, unlike CPPFLAGS
so it can be actually used elsewhere. This should enable us
to remove the AC_SUBSTs in the intel checks, but I have no way
of testing it.

llvm-svn: 161233

9 years agoFall back to selection DAG isel for calls to builtin functions.
Bob Wilson [Fri, 3 Aug 2012 04:06:28 +0000 (04:06 +0000)]
Fall back to selection DAG isel for calls to builtin functions.

Fast isel doesn't currently have support for translating builtin function
calls to target instructions.  For embedded environments where the library
functions are not available, this is a matter of correctness and not
just optimization.  Most of this patch is just arranging to make the
TargetLibraryInfo available in fast isel.  <rdar://problem/12008746>

llvm-svn: 161232

9 years agoAdd new getLibFunc method to TargetLibraryInfo.
Bob Wilson [Fri, 3 Aug 2012 04:06:22 +0000 (04:06 +0000)]
Add new getLibFunc method to TargetLibraryInfo.

This just provides a way to look up a LibFunc::Func enum value for a
function name.  Alphabetize the enums and function names so we can use a
binary search.

llvm-svn: 161231

9 years ago[arm-fast-isel] Add support for shl, lshr, and ashr.
Jush Lu [Fri, 3 Aug 2012 02:37:48 +0000 (02:37 +0000)]
[arm-fast-isel] Add support for shl, lshr, and ashr.

llvm-svn: 161230

9 years ago[CMake] Add yaml2obj to check-llvm.
NAKAMURA Takumi [Fri, 3 Aug 2012 00:45:32 +0000 (00:45 +0000)]
[CMake] Add yaml2obj to check-llvm.

llvm-svn: 161229

9 years agoMove the "findUsedStructTypes" functionality outside of the Module class.
Bill Wendling [Fri, 3 Aug 2012 00:30:35 +0000 (00:30 +0000)]
Move the "findUsedStructTypes" functionality outside of the Module class.

The "findUsedStructTypes" method is very expensive to run. It needs to be
optimized so that LTO can run faster. Splitting this method out of the Module
class will help this occur. For instance, it can keep a list of seen objects so
that it doesn't process them over and over again.

llvm-svn: 161228

9 years agoAdd some missing functions to builtins.py.
Eric Christopher [Fri, 3 Aug 2012 00:13:44 +0000 (00:13 +0000)]
Add some missing functions to builtins.py.


llvm-svn: 161227

9 years agoAdd support for the ARM GHC calling convention, this patch was in 3.0,
Eric Christopher [Fri, 3 Aug 2012 00:05:53 +0000 (00:05 +0000)]
Add support for the ARM GHC calling convention, this patch was in 3.0,
but somehow managed to be dropped later.

Patch by Karel Gardas.

llvm-svn: 161226

9 years agoComment AST: convert a huge if -- else if statement on Decl's type into a
Dmitri Gribenko [Fri, 3 Aug 2012 00:01:01 +0000 (00:01 +0000)]
Comment AST: convert a huge if -- else if statement on Decl's type into a
switch.  Thanks Sean Silva for suggestion!

llvm-svn: 161225

9 years ago[analyzer] Solve another source of non-determinism in the diagnostic
Anna Zaks [Thu, 2 Aug 2012 23:41:05 +0000 (23:41 +0000)]
[analyzer] Solve another source of non-determinism in the diagnostic

The code that was supposed to split the tie in a deterministic way is
not deterministic. Most likely one of the profile methods uses a
pointer. After this change we do finally get the consistent diagnostic
output. Testing this requires running the analyzer on large code bases
and diffing the results.

llvm-svn: 161224

9 years agoRemove redundant '== true' after a comparison.
Richard Trieu [Thu, 2 Aug 2012 23:22:39 +0000 (23:22 +0000)]
Remove redundant '== true' after a comparison.

llvm-svn: 161223

9 years agoARM: Tidy up. Remove unused template parameters.
Jim Grosbach [Thu, 2 Aug 2012 22:08:27 +0000 (22:08 +0000)]
ARM: Tidy up. Remove unused template parameters.

llvm-svn: 161222

9 years agoUpdate status.
Howard Hinnant [Thu, 2 Aug 2012 22:06:41 +0000 (22:06 +0000)]
Update status.

llvm-svn: 161221

9 years agoARM: More InstAlias refactors to use #NAME#.
Jim Grosbach [Thu, 2 Aug 2012 21:59:52 +0000 (21:59 +0000)]
ARM: More InstAlias refactors to use #NAME#.

llvm-svn: 161220

9 years agoMove test yaml files under Inputs until they are converted to be the actual
Matt Beaumont-Gay [Thu, 2 Aug 2012 21:52:49 +0000 (21:52 +0000)]
Move test yaml files under Inputs until they are converted to be the actual
test files.

llvm-svn: 161219

9 years agoARM: Refactor instaliases using TableGen support for #NAME#.
Jim Grosbach [Thu, 2 Aug 2012 21:50:41 +0000 (21:50 +0000)]
ARM: Refactor instaliases using TableGen support for #NAME#.

Now that TableGen supports references to NAME w/o it being explicitly
referenced in the definition's own name, use that to simplify
assembly InstAlias definitions in multiclasses.

llvm-svn: 161218

9 years agoComments AST: refactor DeclInfo to use an enum for decl kind instead of
Dmitri Gribenko [Thu, 2 Aug 2012 21:45:39 +0000 (21:45 +0000)]
Comments AST: refactor DeclInfo to use an enum for decl kind instead of
separate flags.

llvm-svn: 161217

9 years ago[driver] Lipo can handle the lto-bc type.
Chad Rosier [Thu, 2 Aug 2012 21:39:47 +0000 (21:39 +0000)]
[driver] Lipo can handle the lto-bc type.

llvm-svn: 161216

9 years agoComments: handle template paramter documentation in alias-declaration
Dmitri Gribenko [Thu, 2 Aug 2012 21:36:57 +0000 (21:36 +0000)]
Comments: handle template paramter documentation in alias-declaration

llvm-svn: 161215

9 years ago[analyzer] Add a simple check for initializing reference variables with null.
Jordan Rose [Thu, 2 Aug 2012 21:33:42 +0000 (21:33 +0000)]
[analyzer] Add a simple check for initializing reference variables with null.

There's still more work to be done here; this doesn't catch reference
parameters or return values. But it's a step in the right direction.

Part of <rdar://problem/11212286>.

llvm-svn: 161214

9 years agoAttaching comments to declarations: handle using-declaration.
Dmitri Gribenko [Thu, 2 Aug 2012 20:49:51 +0000 (20:49 +0000)]
Attaching comments to declarations: handle using-declaration.

llvm-svn: 161211

9 years agoUpdating Xcode project version numbers for lldb-164 and debugserver-191
Sean Callanan [Thu, 2 Aug 2012 20:40:53 +0000 (20:40 +0000)]
Updating Xcode project version numbers for lldb-164 and debugserver-191

llvm-svn: 161209

9 years agoX86 Peephole: fold loads to the source register operand if possible.
Manman Ren [Thu, 2 Aug 2012 19:37:32 +0000 (19:37 +0000)]
X86 Peephole: fold loads to the source register operand if possible.

Add more comments and use early returns to reduce nesting in isLoadFoldable.
Also disable folding for V_SET0 to avoid introducing a const pool entry and
a const pool load.

rdar://10554090 and rdar://11873276

llvm-svn: 161207