platform/upstream/llvm.git
11 years agoclang/test/CodeGen/ms-inline-asm.c: It requires x86 codegen. Reported by Joey Gouly.
NAKAMURA Takumi [Thu, 27 Sep 2012 14:55:08 +0000 (14:55 +0000)]
clang/test/CodeGen/ms-inline-asm.c: It requires x86 codegen. Reported by Joey Gouly.

llvm-svn: 164775

11 years agoFollowing up on r164620, cope with symlinking from an embedded
Douglas Gregor [Thu, 27 Sep 2012 14:50:15 +0000 (14:50 +0000)]
Following up on r164620, cope with symlinking from an embedded
framework location out to a top-level framework. Such frameworks are
not really embedded at all.

llvm-svn: 164774

11 years agoAdd a missing const qualifier.
Evgeniy Stepanov [Thu, 27 Sep 2012 13:21:08 +0000 (13:21 +0000)]
Add a missing const qualifier.

llvm-svn: 164773

11 years agoQuick fix data/bss detection in TSan.
Evgeniy Stepanov [Thu, 27 Sep 2012 13:20:40 +0000 (13:20 +0000)]
Quick fix data/bss detection in TSan.

The old way breaks when a module's bss is adjacent to the [heap] vm area.
Both ways are not very reliable, though.

llvm-svn: 164772

11 years agoShrink LinkageInfo from 96 bits to 8 bits.
Benjamin Kramer [Thu, 27 Sep 2012 12:52:55 +0000 (12:52 +0000)]
Shrink LinkageInfo from 96 bits to 8 bits.

llvm-svn: 164771

11 years agoRevert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See:...
Sylvestre Ledru [Thu, 27 Sep 2012 10:16:10 +0000 (10:16 +0000)]
Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: en.wikipedia.org/wiki/If_and_only_if Commit 164766

llvm-svn: 164769

11 years agoRevert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See:...
Sylvestre Ledru [Thu, 27 Sep 2012 10:14:43 +0000 (10:14 +0000)]
Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: en.wikipedia.org/wiki/If_and_only_if Commit 164767

llvm-svn: 164768

11 years agoFix a typo 'iff' => 'if'
Sylvestre Ledru [Thu, 27 Sep 2012 09:59:43 +0000 (09:59 +0000)]
Fix a typo 'iff' => 'if'

llvm-svn: 164767

11 years agoFix a typo 'iff' => 'if'
Sylvestre Ledru [Thu, 27 Sep 2012 09:57:10 +0000 (09:57 +0000)]
Fix a typo 'iff' => 'if'

llvm-svn: 164766

11 years ago[TSan] move replacement for new/delete back into tsan_interceptors
Alexey Samsonov [Thu, 27 Sep 2012 09:50:19 +0000 (09:50 +0000)]
[TSan] move replacement for new/delete back into tsan_interceptors

llvm-svn: 164764

11 years agoPrefer shuffles to selects. Backends love shuffles!
Nick Lewycky [Thu, 27 Sep 2012 08:33:56 +0000 (08:33 +0000)]
Prefer shuffles to selects. Backends love shuffles!

llvm-svn: 164763

11 years agoAdd constructors to the attribute builder.
Bill Wendling [Thu, 27 Sep 2012 07:22:30 +0000 (07:22 +0000)]
Add constructors to the attribute builder.

llvm-svn: 164762

11 years agoAdd missing function CreateFPCast to the TargetFolder. It's there in the other
Nick Lewycky [Thu, 27 Sep 2012 06:33:40 +0000 (06:33 +0000)]
Add missing function CreateFPCast to the TargetFolder. It's there in the other
folders and not having it here fails to compile if you actually try to use it.

Also, CreatePointerCast was failing to do the part where it does TD-aware
constant folding. Granted there is exactly one case where that it will ever
do anything, but there's no reason to skip it. For reference, that case is a
subtraction between two constant offsets on the same global variable, eg.,
"&A[123] - &A[4].f".

llvm-svn: 164760

11 years ago[arm-fast-isel] Add support for ELF PIC.
Jush Lu [Thu, 27 Sep 2012 05:21:41 +0000 (05:21 +0000)]
[arm-fast-isel] Add support for ELF PIC.

This is a preliminary step towards ELF support; currently ARMFastISel hasn't
been used for ELF object files yet.

llvm-svn: 164759

11 years agoTest case for r164755 and 164756.
Akira Hatanaka [Thu, 27 Sep 2012 04:12:30 +0000 (04:12 +0000)]
Test case for r164755 and 164756.

llvm-svn: 164757

11 years agoMIPS DSP: rddsp (instruction which reads DSPControl register fields to a GPR).
Akira Hatanaka [Thu, 27 Sep 2012 04:08:42 +0000 (04:08 +0000)]
MIPS DSP: rddsp (instruction which reads DSPControl register fields to a GPR).

llvm-svn: 164756

11 years agoMIPS DSP: CMPU.EQ.QB instruction sub-class.
Akira Hatanaka [Thu, 27 Sep 2012 03:58:34 +0000 (03:58 +0000)]
MIPS DSP: CMPU.EQ.QB instruction sub-class.

llvm-svn: 164755

11 years agoMIPS DSP: ADDU.QB instruction sub-class.
Akira Hatanaka [Thu, 27 Sep 2012 03:13:59 +0000 (03:13 +0000)]
MIPS DSP: ADDU.QB instruction sub-class.

llvm-svn: 164754

11 years agoAdded the ability to download a symboled executable and symbol file given a UUID.
Greg Clayton [Thu, 27 Sep 2012 03:13:55 +0000 (03:13 +0000)]
Added the ability to download a symboled executable and symbol file given a UUID.

llvm-svn: 164753

11 years agoChange the kdp-remote alias to require a hostname (instead of allowing a zero-length...
Jason Molenda [Thu, 27 Sep 2012 02:47:55 +0000 (02:47 +0000)]
Change the kdp-remote alias to require a hostname (instead of allowing a zero-length hostname to be specified).

llvm-svn: 164752

11 years agoMIPS DSP: Branch on Greater Than or Equal To Value 32 in DSPControl Pos Field instruc...
Akira Hatanaka [Thu, 27 Sep 2012 02:15:57 +0000 (02:15 +0000)]
MIPS DSP: Branch on Greater Than or Equal To Value 32 in DSPControl Pos Field instruction.

llvm-svn: 164751

11 years agoMIPS DSP: all the remaining instructions which read or write accumulators.
Akira Hatanaka [Thu, 27 Sep 2012 02:11:20 +0000 (02:11 +0000)]
MIPS DSP: all the remaining instructions which read or write accumulators.

llvm-svn: 164750

11 years agoMIPS DSP: add support for extract-word instructions.
Akira Hatanaka [Thu, 27 Sep 2012 02:05:42 +0000 (02:05 +0000)]
MIPS DSP: add support for extract-word instructions.

llvm-svn: 164749

11 years agoMIPS DSP: add functions which decode DSP and accumulator registers.
Akira Hatanaka [Thu, 27 Sep 2012 02:01:10 +0000 (02:01 +0000)]
MIPS DSP: add functions which decode DSP and accumulator registers.

llvm-svn: 164748

11 years agoMIPS DSP: add code necessary for pseudo instruction lowering.
Akira Hatanaka [Thu, 27 Sep 2012 01:59:07 +0000 (01:59 +0000)]
MIPS DSP: add code necessary for pseudo instruction lowering.

llvm-svn: 164747

11 years agoMIPS DSP: add bitcast patterns between vectors and int.
Akira Hatanaka [Thu, 27 Sep 2012 01:56:38 +0000 (01:56 +0000)]
MIPS DSP: add bitcast patterns between vectors and int.

No test cases. These patterns will get tested along with dsp intrinsics.

llvm-svn: 164746

11 years agoIvarInvalidationChecker.cpp: Remove an unused member, InterfD. [-Wunused-private...
NAKAMURA Takumi [Thu, 27 Sep 2012 01:52:00 +0000 (01:52 +0000)]
IvarInvalidationChecker.cpp: Remove an unused member, InterfD. [-Wunused-private-field]

llvm-svn: 164745

11 years agoMIPS DSP: add vector load/store patterns.
Akira Hatanaka [Thu, 27 Sep 2012 01:50:59 +0000 (01:50 +0000)]
MIPS DSP: add vector load/store patterns.

llvm-svn: 164744

11 years agoPer discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917...
Argyrios Kyrtzidis [Thu, 27 Sep 2012 01:42:07 +0000 (01:42 +0000)]
Per discussion in lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

llvm-svn: 164743

11 years agoUse %clang_cc1 so that the test works even if the target isn't available.
Jordan Rose [Thu, 27 Sep 2012 01:40:12 +0000 (01:40 +0000)]
Use %clang_cc1 so that the test works even if the target isn't available.

Xcode-style clang builds only support Xcode's architectures, so mips
isn't available and the driver tries to use gcc instead. cc1 will go
ahead and do -fsyntax-only for any platform it knows about even if it
can't actually compile.

llvm-svn: 164742

11 years agoImplement returning integer values in "thread return" for arm, x86_64 and i386. ...
Jim Ingham [Thu, 27 Sep 2012 01:15:29 +0000 (01:15 +0000)]
Implement returning integer values in "thread return" for arm, x86_64 and i386.  Also returns
floats & doubles on x86_64.

<rdar://problem/8356523>

llvm-svn: 164741

11 years ago[libclang] Always report a CXCursor_MacroDefinition for code-completion
Argyrios Kyrtzidis [Thu, 27 Sep 2012 00:24:09 +0000 (00:24 +0000)]
[libclang] Always report a CXCursor_MacroDefinition for code-completion
results for a macro name, not CXCursor_NotImplemented.

llvm-svn: 164740

11 years agoUse a variable to stop us from building clang testing tools.
Bill Wendling [Thu, 27 Sep 2012 00:11:09 +0000 (00:11 +0000)]
Use a variable to stop us from building clang testing tools.
<rdar://problem/11202465>

llvm-svn: 164739

11 years agoIf we are attached to a platform, then make sure that we can verify that a process...
Greg Clayton [Thu, 27 Sep 2012 00:03:39 +0000 (00:03 +0000)]
If we are attached to a platform, then make sure that we can verify that a process exists when attaching by "pid" before we try and do a lengthy command that could take a while to timeout.

llvm-svn: 164738

11 years agoAdded "k" as an alias to "process kill" since the new "kdb-remote" will now conflict...
Greg Clayton [Thu, 27 Sep 2012 00:02:27 +0000 (00:02 +0000)]
Added "k" as an alias to "process kill" since the new "kdb-remote" will now conflict with it.

llvm-svn: 164737

11 years agoFix of hang during Intel JIT profiling
Andrew Kaylor [Wed, 26 Sep 2012 23:43:56 +0000 (23:43 +0000)]
Fix of hang during Intel JIT profiling
Committed on behalf of Kirill Uhanov

llvm-svn: 164736

11 years agoBuildbot Fix.
Bill Wendling [Wed, 26 Sep 2012 23:38:00 +0000 (23:38 +0000)]
Buildbot Fix.

This method can be called with a '0' argument which checks the return
value. However, the method it calls doesn't expect '0' as a valid value. Call the
correct method when it's 0.

llvm-svn: 164735

11 years agoTurn off this test, as the new and old SROA cause it produce different output.
Nick Lewycky [Wed, 26 Sep 2012 22:48:46 +0000 (22:48 +0000)]
Turn off this test, as the new and old SROA cause it produce different output.
Left in a note that we need to turn it back on once the SROA fallout is cleared
up.

llvm-svn: 164733

11 years agoAdd case for typeConstant in SectionChunk
Sid Manning [Wed, 26 Sep 2012 22:46:17 +0000 (22:46 +0000)]
Add case for typeConstant in SectionChunk

llvm-svn: 164732

11 years agoDisable the new SROA pass to get the tree back in working order. We don't yet
Nick Lewycky [Wed, 26 Sep 2012 22:43:04 +0000 (22:43 +0000)]
Disable the new SROA pass to get the tree back in working order. We don't yet
have testcases for the current problems.

llvm-svn: 164731

11 years agoAdd examples of using the kdp-remote and gdb-remote commands to connect to
Jason Molenda [Wed, 26 Sep 2012 22:42:25 +0000 (22:42 +0000)]
Add examples of using the kdp-remote and gdb-remote commands to connect to
gdb-remote protocol and kdp protocol systems.

llvm-svn: 164730

11 years agoAdd convenience aliases to allow easy attaching to a remote gdb server or kdp (darwin...
Greg Clayton [Wed, 26 Sep 2012 22:26:47 +0000 (22:26 +0000)]
Add convenience aliases to allow easy attaching to a remote gdb server or kdp (darwin kernel) server with the new "gdb-remote" regex alias and "kdp-remote" regex alias commands.

llvm-svn: 164729

11 years agoAdd IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
Dan Gohman [Wed, 26 Sep 2012 22:17:14 +0000 (22:17 +0000)]
Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.

llvm-svn: 164728

11 years agoQuery the parameter attributes directly instead of using the Attribute symbols.
Bill Wendling [Wed, 26 Sep 2012 22:15:19 +0000 (22:15 +0000)]
Query the parameter attributes directly instead of using the Attribute symbols.

llvm-svn: 164727

11 years agoUpdate to new function attribute querying syntax.
Bill Wendling [Wed, 26 Sep 2012 21:59:46 +0000 (21:59 +0000)]
Update to new function attribute querying syntax.

llvm-svn: 164726

11 years agoRemove the `hasFnAttr' method from Function.
Bill Wendling [Wed, 26 Sep 2012 21:48:26 +0000 (21:48 +0000)]
Remove the `hasFnAttr' method from Function.

The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.

llvm-svn: 164725

11 years agoX86_32: Large Symbol+Offset relocations.
Jim Grosbach [Wed, 26 Sep 2012 21:27:45 +0000 (21:27 +0000)]
X86_32: Large Symbol+Offset relocations.

If the offset is more than 24-bits, it won't fit in a scattered
relocation offset field, so we fall back to using a non-scattered
relocation.

rdar://12358909

llvm-svn: 164724

11 years agoAdded support for the DebugClang configuration to the
Sean Callanan [Wed, 26 Sep 2012 21:16:15 +0000 (21:16 +0000)]
Added support for the DebugClang configuration to the
testsuite.

llvm-svn: 164723

11 years agoInitial commit for the AttributesImpl class.
Bill Wendling [Wed, 26 Sep 2012 21:07:29 +0000 (21:07 +0000)]
Initial commit for the AttributesImpl class.

This opaque class will contain all of the attributes. All attribute queries will
go through this object. This object will also be uniqued in the LLVMContext.
Currently not used, so no implementation change.

llvm-svn: 164722

11 years agoAdd case clauses for returning dsp accumulator encoding values in function
Akira Hatanaka [Wed, 26 Sep 2012 19:27:24 +0000 (19:27 +0000)]
Add case clauses for returning dsp accumulator encoding values in function
getMipsRegisterNumbering.

llvm-svn: 164720

11 years agoAdd DSP accumulator registers and register class. Remove hi/lo registers.
Akira Hatanaka [Wed, 26 Sep 2012 19:25:21 +0000 (19:25 +0000)]
Add DSP accumulator registers and register class. Remove hi/lo registers.

llvm-svn: 164719

11 years agoDelete member MipsFunctionInfo::OutArgFIRange and code that accesses it.
Akira Hatanaka [Wed, 26 Sep 2012 19:18:19 +0000 (19:18 +0000)]
Delete member MipsFunctionInfo::OutArgFIRange and code that accesses it.

llvm-svn: 164718

11 years agoAllow -MF to be used in combination with -E -M or -E -MM.
Benjamin Kramer [Wed, 26 Sep 2012 19:01:49 +0000 (19:01 +0000)]
Allow -MF to be used in combination with -E -M or -E -MM.

Fixes PR13851. Patch by Dimitry Andric!

llvm-svn: 164717

11 years ago[analyzer] Add experimental ObjC invalidation method checker.
Anna Zaks [Wed, 26 Sep 2012 18:55:16 +0000 (18:55 +0000)]
[analyzer] Add experimental ObjC invalidation method checker.

This checker is annotation driven. It checks that the annotated
invalidation method accesses all ivars of the enclosing objects that are
objects of type, which in turn contains an invalidation method.

This is driven by
__attribute((annotation("objc_instance_variable_invalidator")).

llvm-svn: 164716

11 years ago[analyzer] Commit a test case for r164579.
Anna Zaks [Wed, 26 Sep 2012 18:55:09 +0000 (18:55 +0000)]
[analyzer] Commit a test case for r164579.

llvm-svn: 164715

11 years agoAdd support for detecting some corei7-class Xeons.
Benjamin Kramer [Wed, 26 Sep 2012 18:21:47 +0000 (18:21 +0000)]
Add support for detecting some corei7-class Xeons.

llvm-svn: 164714

11 years agoHave set-xcode-analyer report an error if no xcspec file could be found.
Ted Kremenek [Wed, 26 Sep 2012 18:19:55 +0000 (18:19 +0000)]
Have set-xcode-analyer report an error if no xcspec file could be found.

llvm-svn: 164713

11 years agoMake set-xcode-analyzer more tolerant of the naming differenes reported by xcode...
Ted Kremenek [Wed, 26 Sep 2012 18:13:03 +0000 (18:13 +0000)]
Make set-xcode-analyzer more tolerant of the naming differenes reported by xcode-select.

llvm-svn: 164712

11 years agoRevert "Use sep instead of ' '."
Ted Kremenek [Wed, 26 Sep 2012 18:06:08 +0000 (18:06 +0000)]
Revert "Use sep instead of ' '."

This isn't correct, as Jordan correctly points out.

llvm-svn: 164711

11 years agoFix template instantiation of attributes. More specifically, fix the case
DeLesley Hutchins [Wed, 26 Sep 2012 17:57:31 +0000 (17:57 +0000)]
Fix template instantiation of attributes.  More specifically, fix the case
where an attribute is attached to a forward declaration of a template function,
and refers to parameters of that declaration, but is then inherited by the
definition of that function.  When the definition is instantiated, the
parameter references need to be remapped.

llvm-svn: 164710

11 years agoUse sep instead of ' '.
Ted Kremenek [Wed, 26 Sep 2012 17:23:31 +0000 (17:23 +0000)]
Use sep instead of ' '.

llvm-svn: 164709

11 years agoNow that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
Duncan Sands [Wed, 26 Sep 2012 17:16:01 +0000 (17:16 +0000)]
Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
teach the callgraph logic to not create callgraph edges to intrinsics for invoke
instructions; it already skips this for call instructions.  Fixes PR13903.

llvm-svn: 164707

11 years agoMake our mini-stdint.h platform-independent by using predefined macros.
Jordan Rose [Wed, 26 Sep 2012 16:41:11 +0000 (16:41 +0000)]
Make our mini-stdint.h platform-independent by using predefined macros.

This also adds a definition for uint64_t, which was causing build failures
on some platforms. (I'm actually surprised this didn't happen on more
builders, but maybe the search paths are different.)

llvm-svn: 164706

11 years ago[libclang] Remove the ParentKind cursor kind from code-completion results.
Argyrios Kyrtzidis [Wed, 26 Sep 2012 16:39:56 +0000 (16:39 +0000)]
[libclang] Remove the ParentKind cursor kind from code-completion results.

This is to reduce dependency to cursors for the code-completion results.

llvm-svn: 164705

11 years agoHave ASTUnit::Save() return a bool to indicate save error.
Argyrios Kyrtzidis [Wed, 26 Sep 2012 16:39:46 +0000 (16:39 +0000)]
Have ASTUnit::Save() return a bool to indicate save error.

Removes a dependency of ASTUnit to clang-c/Index.h.

llvm-svn: 164704

11 years agoPatch by Matt, to get lldb to build with the updated llvm+clang versions (via Makefiles).
Filipe Cabecinhas [Wed, 26 Sep 2012 16:27:06 +0000 (16:27 +0000)]
Patch by Matt, to get lldb to build with the updated llvm+clang versions (via Makefiles).

llvm-svn: 164703

11 years agoMake lldb more C++11 friendly.
Filipe Cabecinhas [Wed, 26 Sep 2012 16:27:04 +0000 (16:27 +0000)]
Make lldb more C++11 friendly.

llvm-svn: 164702

11 years agoYAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.
Benjamin Kramer [Wed, 26 Sep 2012 15:52:15 +0000 (15:52 +0000)]
YAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.

Fixes PR12632.

llvm-svn: 164701

11 years agoBump _LIBCPP_VERSION to 1002
Howard Hinnant [Wed, 26 Sep 2012 15:38:09 +0000 (15:38 +0000)]
Bump _LIBCPP_VERSION to 1002

llvm-svn: 164700

11 years agoRemove unneeded and invalid SetInsertPoint calls from unittest.
Benjamin Kramer [Wed, 26 Sep 2012 15:16:05 +0000 (15:16 +0000)]
Remove unneeded and invalid SetInsertPoint calls from unittest.

BB->end() returns a sentinel value that is not a legal insert point.

llvm-svn: 164699

11 years agoAPFloat::roundToIntegral: Special values don't keep the exponent value up to date...
Benjamin Kramer [Wed, 26 Sep 2012 14:06:58 +0000 (14:06 +0000)]
APFloat::roundToIntegral: Special values don't keep the exponent value up to date, don't rely on it.

Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer.

llvm-svn: 164698

11 years agoAddress Duncan's comments on r164684:
Hans Wennborg [Wed, 26 Sep 2012 14:01:53 +0000 (14:01 +0000)]
Address Duncan's comments on r164684:

- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.

llvm-svn: 164696

11 years agoFixed a number of gpylint warnings, added binary names filtering (useful for Chrome...
Alexander Potapenko [Wed, 26 Sep 2012 13:16:42 +0000 (13:16 +0000)]
Fixed a number of gpylint warnings, added binary names filtering (useful for Chrome), minor fixes.

llvm-svn: 164695

11 years agoEncapsulate the main loop into a class to allow reusing it.
Alexander Potapenko [Wed, 26 Sep 2012 12:12:41 +0000 (12:12 +0000)]
Encapsulate the main loop into a class to allow reusing it.

llvm-svn: 164694

11 years agoSet --use-symbol-table=true as Alexey has already resolved the FIXME.
Alexander Potapenko [Wed, 26 Sep 2012 11:36:14 +0000 (11:36 +0000)]
Set --use-symbol-table=true as Alexey has already resolved the FIXME.

llvm-svn: 164693

11 years agoAddress Duncan's comments on r164682:
Hans Wennborg [Wed, 26 Sep 2012 11:07:37 +0000 (11:07 +0000)]
Address Duncan's comments on r164682:

- Finish assert messages with exclamation mark
- Move overflow checking into ShouldBuildLookupTable.

llvm-svn: 164692

11 years agoAnalogous fix to memset and memcpy rewriting. Don't have a test case
Chandler Carruth [Wed, 26 Sep 2012 10:59:22 +0000 (10:59 +0000)]
Analogous fix to memset and memcpy rewriting. Don't have a test case
contrived for these yet, as I spotted them by inspection and the test
cases are a bit more tricky to phrase.

llvm-svn: 164691

11 years agoWhen rewriting the pointer operand to a load or store which has
Chandler Carruth [Wed, 26 Sep 2012 10:45:28 +0000 (10:45 +0000)]
When rewriting the pointer operand to a load or store which has
alignment guarantees attached, re-compute the alignment so that we
consider offsets which impact alignment.

llvm-svn: 164690

11 years agoTeach all of the loads, stores, memsets and memcpys created by the
Chandler Carruth [Wed, 26 Sep 2012 10:27:46 +0000 (10:27 +0000)]
Teach all of the loads, stores, memsets and memcpys created by the
rewriter in SROA to carry a proper alignment. This involves
interrogating various sources of alignment, etc. This is a more complete
and principled fix to PR13920 as well as related bugs pointed out by Eli
in review and by inspection in the area.

Also by inspection fix the integer and vector promotion paths to create
aligned loads and stores. I still need to work up test cases for
these... Sorry for the delay, they were found purely by inspection.

llvm-svn: 164689

11 years agoAdd some convenience methods to IRBuilder for constructing aligned loads
Chandler Carruth [Wed, 26 Sep 2012 10:27:40 +0000 (10:27 +0000)]
Add some convenience methods to IRBuilder for constructing aligned loads
and stores. These will be used in subsequnet patches to SROA to more
systematically manage the alignment on loads and stores.

llvm-svn: 164688

11 years agoARM/atomicrmw_minmax.ll: Fix RUN line.
NAKAMURA Takumi [Wed, 26 Sep 2012 10:12:20 +0000 (10:12 +0000)]
ARM/atomicrmw_minmax.ll: Fix RUN line.

llvm-svn: 164687

11 years agoFix tests that didn't test anything.
Benjamin Kramer [Wed, 26 Sep 2012 09:51:39 +0000 (09:51 +0000)]
Fix tests that didn't test anything.

llvm-svn: 164686

11 years agoFix ordering of operands on lowering of atomicrmw min/max nodes on ARM.
James Molloy [Wed, 26 Sep 2012 09:48:32 +0000 (09:48 +0000)]
Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.

llvm-svn: 164685

11 years agoSimplifyCFG: Make the switch-to-lookup table transformation store the
Hans Wennborg [Wed, 26 Sep 2012 09:44:49 +0000 (09:44 +0000)]
SimplifyCFG: Make the switch-to-lookup table transformation store the
tables in bitmaps when they fit in a target-legal register.

This saves some space, and it also allows for building tables that would
otherwise be deemed too sparse.

One interesting case that this hits is example 7 from
http://blog.regehr.org/archives/320. We currently generate good code
for this when lowering the switch to the selection DAG: we build a
bitmask to decide whether to jump to one block or the other. My patch
will result in the same bitmask, but it removes the need for the jump,
as the return value can just be retrieved from the mask.

llvm-svn: 164684

11 years agoFix build failure and enhance the testcase for unwind.h.
Logan Chien [Wed, 26 Sep 2012 09:40:37 +0000 (09:40 +0000)]
Fix build failure and enhance the testcase for unwind.h.

llvm-svn: 164683

11 years agoSimplifyCFG: Refactor the switch-to-lookup table transformation by
Hans Wennborg [Wed, 26 Sep 2012 09:34:53 +0000 (09:34 +0000)]
SimplifyCFG: Refactor the switch-to-lookup table transformation by
breaking out the building of lookup tables into a separate class.

llvm-svn: 164682

11 years agollvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.
NAKAMURA Takumi [Wed, 26 Sep 2012 09:24:12 +0000 (09:24 +0000)]
llvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.

llvm-svn: 164681

11 years agoRun test in a freestanding environment so it doesn't accidentally pick up system...
Benjamin Kramer [Wed, 26 Sep 2012 09:10:53 +0000 (09:10 +0000)]
Run test in a freestanding environment so it doesn't accidentally pick up system headers for the wrong target.

While there add a test that verifies that the header parses in C++ mode.

llvm-svn: 164679

11 years agoFix two more tests that didn't do anything.
Nico Weber [Wed, 26 Sep 2012 09:09:17 +0000 (09:09 +0000)]
Fix two more tests that didn't do anything.

Found with
  find test -type f | xargs grep RUN: | grep '%clang' | grep -iv '%s' | grep -v '%t' | grep -v '\\$'

llvm-svn: 164678

11 years agoMake this test actually test something
Nico Weber [Wed, 26 Sep 2012 09:02:07 +0000 (09:02 +0000)]
Make this test actually test something

llvm-svn: 164677

11 years agoThe assumption that /proc/self/exe always exists is incorrect.
Sylvestre Ledru [Wed, 26 Sep 2012 08:30:35 +0000 (08:30 +0000)]
The assumption that /proc/self/exe always exists is incorrect.
For example, under a Linux chroot, /proc/ might not be mounted.
Therefor, we test if this file exist. If it is the case, use it (the current
behavior). Otherwise, we fall back to the detection used by *BSD.

The issue has been reported initially on the Debian bug tracker:
http://bugs.debian.org/674588

llvm-svn: 164676

11 years agoAdd SARX/SHRX/SHLX code generation support
Michael Liao [Wed, 26 Sep 2012 08:26:25 +0000 (08:26 +0000)]
Add SARX/SHRX/SHLX code generation support

llvm-svn: 164675

11 years agoAdd RORX code generation support
Michael Liao [Wed, 26 Sep 2012 08:24:51 +0000 (08:24 +0000)]
Add RORX code generation support

llvm-svn: 164674

11 years agoAdd MULX code generation support
Michael Liao [Wed, 26 Sep 2012 08:22:37 +0000 (08:22 +0000)]
Add MULX code generation support

llvm-svn: 164673

11 years agoRevert r163022, it caused PR13924.
Nico Weber [Wed, 26 Sep 2012 08:19:01 +0000 (08:19 +0000)]
Revert r163022, it caused PR13924.

Add a test for PR13924. Do not revert the test added in r163022,
it surprisingly still passes even after reverting the code changes.

llvm-svn: 164672

11 years agoTeach the 'lint' sanity checking pass to detect simple buffer overflows.
Duncan Sands [Wed, 26 Sep 2012 07:45:36 +0000 (07:45 +0000)]
Teach the 'lint' sanity checking pass to detect simple buffer overflows.

llvm-svn: 164671

11 years agoRevert r164663 due to buildbot failure.
Craig Topper [Wed, 26 Sep 2012 07:43:06 +0000 (07:43 +0000)]
Revert r164663 due to buildbot failure.

llvm-svn: 164670

11 years agoRevert the business end of r164636 and try again. I'll come in again. ;]
Chandler Carruth [Wed, 26 Sep 2012 07:41:40 +0000 (07:41 +0000)]
Revert the business end of r164636 and try again. I'll come in again. ;]

This should really, really fix PR13916. For real this time. The
underlying bug is... a bit more subtle than I had imagined.

The setup is a code pattern that leads to an @llvm.memcpy call with two
equal pointers to an alloca in the source and dest. Now, not any pattern
will do. The alloca needs to be formed just so, and both pointers should
be wrapped in different bitcasts etc. When this precise pattern hits,
a funny sequence of events transpires. First, we correctly detect the
potential for overlap, and correctly optimize the memcpy. The first
time. However, we do simplify the set of users of the alloca, and that
causes us to run the alloca back through the SROA pass in case there are
knock-on simplifications. At this point, a curious thing has happened.
If we happen to have an i8 alloca, we have direct i8 pointer values. So
we don't bother creating a cast, we rewrite the arguments to the memcpy
to dircetly refer to the alloca.

Now, in an unrelated area of the pass, we have clever logic which
ensures that when visiting each User of a particular pointer derived
from an alloca, we only visit that User once, and directly inspect all
of its operands which refer to that particular pointer value. However,
the mechanism used to detect memcpy's with the potential to overlap
relied upon getting visited once per *Use*, not once per *User*. This is
always true *unless* the same exact value is both source and dest. It
turns out that almost nothing actually produces that pattern though.

We can hand craft test cases that more directly test this behavior of
course, and those are included. Also, note that there is a significant
missed optimization here -- we prove in many cases that there is
a non-volatile memcpy call with identical source and dest addresses. We
shouldn't prevent splitting the alloca in that case, and in fact we
should just remove such memcpy calls eagerly. I'll address that in
a subsequent commit.

llvm-svn: 164669

11 years agoAdd is16BitVector and is32BitVector to MVT and call them from EVT. Matches other...
Craig Topper [Wed, 26 Sep 2012 07:17:37 +0000 (07:17 +0000)]
Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.

llvm-svn: 164668

11 years agoReplace calls to getSizeInBits with getExtendedSizeInBits since its already known...
Craig Topper [Wed, 26 Sep 2012 07:11:42 +0000 (07:11 +0000)]
Replace calls to getSizeInBits with getExtendedSizeInBits since its already known its an extended type.

llvm-svn: 164667