Bill Wendling [Tue, 16 Oct 2012 18:06:06 +0000 (18:06 +0000)]
Use the appropriate Attributes::get method to create an Attributes object.
llvm-svn: 166035
Joerg Sonnenberger [Tue, 16 Oct 2012 17:45:27 +0000 (17:45 +0000)]
When using a symbol with attribute weakref, search for it first and
don't try the normal GetOrCreateLLVM. The latter could drop the weak
atrtibute on the second reference, if there is no explicit declaration
of the aliasee.
llvm-svn: 166032
Owen Anderson [Tue, 16 Oct 2012 17:10:33 +0000 (17:10 +0000)]
Speculative fix the mask constants to be of type uintptr_t. I don't know of any case where the old form was incorrect, but I'm more confident that such cases don't exist in this version.
llvm-svn: 166031
Fariborz Jahanian [Tue, 16 Oct 2012 17:08:11 +0000 (17:08 +0000)]
Minor tweak to last patch along with a test case.
// rdar://
12491143
llvm-svn: 166030
Alexander Potapenko [Tue, 16 Oct 2012 16:58:10 +0000 (16:58 +0000)]
Do not call ReplaceCFAllocator() before __CFInitialize(), otherwise crashes are possible on 10.8.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=122
llvm-svn: 166029
Alexander Potapenko [Tue, 16 Oct 2012 16:48:51 +0000 (16:48 +0000)]
Commit a leftover file from r166026: Add MACOS_VERSION_MOUNTAIN_LION.
llvm-svn: 166028
Alexander Potapenko [Tue, 16 Oct 2012 16:24:49 +0000 (16:24 +0000)]
Add MACOS_VERSION_MOUNTAIN_LION.
llvm-svn: 166026
Fariborz Jahanian [Tue, 16 Oct 2012 16:21:20 +0000 (16:21 +0000)]
fixes an objc crash involving objc bool literal on
hopelessly poorly written code after spewing several
errors. // rdar://
12491143
llvm-svn: 166025
Dmitri Gribenko [Tue, 16 Oct 2012 15:37:50 +0000 (15:37 +0000)]
Fix function parameter spelling in comments. Caught by -Wdocumentation.
llvm-svn: 166024
David Chisnall [Tue, 16 Oct 2012 15:11:55 +0000 (15:11 +0000)]
GNUstep runtime version default to 1.6, generate correct property attribute
metadata.
llvm-svn: 166023
Bill Schmidt [Tue, 16 Oct 2012 13:30:53 +0000 (13:30 +0000)]
This patch addresses PR13949.
For the PowerPC 64-bit ELF Linux ABI, aggregates of size less than 8
bytes are to be passed in the low-order bits ("right-adjusted") of the
doubleword register or memory slot assigned to them. A previous patch
addressed this for aggregates passed in registers. However, small
aggregates passed in the overflow portion of the parameter save area are
still being passed left-adjusted.
The fix is made in PPCTargetLowering::LowerCall_Darwin_Or_64SVR4 on the
caller side, and in PPCTargetLowering::LowerFormalArguments_64SVR4 on
the callee side. The main fix on the callee side simply extends
existing logic for 1- and 2-byte objects to 1- through 7-byte objects,
and correcting a constant left over from 32-bit code. There is also a
fix to a bogus calculation of the offset to the following argument in
the parameter save area.
On the caller side, again a constant left over from 32-bit code is
fixed. Additionally, some code for 1, 2, and 4-byte objects is
duplicated to handle the 3, 5, 6, and 7-byte objects for SVR4 only. The
LowerCall_Darwin_Or_64SVR4 logic is getting fairly convoluted trying to
handle both ABIs, and I propose to separate this into two functions in a
future patch, at which time the duplication can be removed.
The patch adds a new test (structsinmem.ll) to demonstrate correct
passing of structures of all seven sizes. Eight dummy parameters are
used to force these structures to be in the overflow portion of the
parameter save area.
As a side effect, this corrects the case when aggregates passed in
registers are saved into the first eight doublewords of the parameter
save area: Previously they were stored left-justified, and now are
properly stored right-justified. This requires changing the expected
output of existing test case structsinregs.ll.
llvm-svn: 166022
Tobias Grosser [Tue, 16 Oct 2012 07:29:19 +0000 (07:29 +0000)]
isl scheduler: Do not fail when returning an empty band list
The bug was within isl. To fix it, we simply update the isl version that
is used by Polly. We still have some changes within Polly to be able to
write a proper test case.
Reported-by: Sameer Sahasrabuddhe <Sameer.Sahasrabuddhe@amd.com>
llvm-svn: 166021
Tobias Grosser [Tue, 16 Oct 2012 07:29:13 +0000 (07:29 +0000)]
isl-codegen: Support '<' and '>'
Previously isl always generated '<=' or '>='. However, in many cases '<' or '>'
leads to simpler code. This commit updates isl and adds the relevant code
generation support to Polly.
llvm-svn: 166020
Alexey Samsonov [Tue, 16 Oct 2012 07:22:28 +0000 (07:22 +0000)]
Transform pattern:
if (CGM.getModuleDebugInfo())
DebugInfo = CGM.getModuleDebugInfo()
into a call:
maybeInitializeDebugInfo();
This is a simplification for a possible future fix of PR13942.
llvm-svn: 166019
Stepan Dyatkovskiy [Tue, 16 Oct 2012 07:16:47 +0000 (07:16 +0000)]
Issue:
Stack is formed improperly for long structures passed as byval arguments for
EABI mode.
If we took AAPCS reference, we can found the next statements:
A: "If the argument requires double-word alignment (8-byte), the NCRN (Next
Core Register Number) is rounded up to the next even register number." (5.5
Parameter Passing, Stage C, C.3).
B: "The alignment of an aggregate shall be the alignment of its most-aligned
component." (4.3 Composite Types, 4.3.1 Aggregates).
So if we have structure with doubles (9 double fields) and 3 Core unused
registers (r1, r2, r3): caller should use r2 and r3 registers only.
Currently r1,r2,r3 set is used, but it is invalid.
Callee VA routine should also use r2 and r3 regs only. All is ok here. This
behaviour is guessed by rounding up SP address with ADD+BFC operations.
Fix:
Main fix is in ARMTargetLowering::HandleByVal. If we detected AAPCS mode and
8 byte alignment, we waste odd registers then.
P.S.:
I also improved LDRB_POST_IMM regression test. Since ldrb instruction will
not generated by current regression test after this patch.
llvm-svn: 166018
NAKAMURA Takumi [Tue, 16 Oct 2012 06:28:34 +0000 (06:28 +0000)]
Reapply r165661, Patch by Shuxin Yang <shuxin.llvm@gmail.com>.
Original message:
The attached is the fix to radar://
11663049. The optimization can be outlined by following rules:
(select (x != c), e, c) -> select (x != c), e, x),
(select (x == c), c, e) -> select (x == c), x, e)
where the <c> is an integer constant.
The reason for this change is that : on x86, conditional-move-from-constant needs two instructions;
however, conditional-move-from-register need only one instruction.
While the LowerSELECT() sounds to be the most convenient place for this optimization, it turns out to be a bad place. The reason is that by replacing the constant <c> with a symbolic value, it obscure some instruction-combining opportunities which would otherwise be very easy to spot. For that reason, I have to postpone the change to last instruction-combining phase.
The change passes the test of "make check-all -C <build-root/test" and "make -C project/test-suite/SingleSource".
Original message since r165661:
My previous change has a bug: I negated the condition code of a CMOV, and go ahead creating a new CMOV using the *ORIGINAL* condition code.
llvm-svn: 166017
Bill Wendling [Tue, 16 Oct 2012 06:10:45 +0000 (06:10 +0000)]
Cleanup whitespace.
llvm-svn: 166016
Owen Anderson [Tue, 16 Oct 2012 06:04:27 +0000 (06:04 +0000)]
Fix a bug in the set(I,E)/reset(I,E) methods that I recently added. The boundary condition for checking if I and E were in the same word were incorrect, and, beyond that, the mask computation was not using a wide enough constant.
llvm-svn: 166015
Craig Topper [Tue, 16 Oct 2012 06:01:50 +0000 (06:01 +0000)]
Move X86MCInstLower class definition into implementation file. It's not needed outside.
llvm-svn: 166014
Bill Wendling [Tue, 16 Oct 2012 06:01:44 +0000 (06:01 +0000)]
Cleanup whitespace.
llvm-svn: 166013
Bill Wendling [Tue, 16 Oct 2012 05:57:28 +0000 (05:57 +0000)]
Have AttributesImpl defriend the Attributes class.
llvm-svn: 166012
Bill Wendling [Tue, 16 Oct 2012 05:55:09 +0000 (05:55 +0000)]
Have AttrBuilder defriend the Attributes class.
llvm-svn: 166011
Bill Wendling [Tue, 16 Oct 2012 05:23:44 +0000 (05:23 +0000)]
Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.
llvm-svn: 166010
Bill Wendling [Tue, 16 Oct 2012 05:23:31 +0000 (05:23 +0000)]
Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.
llvm-svn: 166009
Bill Wendling [Tue, 16 Oct 2012 05:22:28 +0000 (05:22 +0000)]
Put simple c'tors inline.
llvm-svn: 166008
Bill Wendling [Tue, 16 Oct 2012 05:20:51 +0000 (05:20 +0000)]
Pass in the context to the Attributes::get method.
llvm-svn: 166007
Kostya Serebryany [Tue, 16 Oct 2012 04:50:32 +0000 (04:50 +0000)]
[asan] fix lint
llvm-svn: 166006
Jason Molenda [Tue, 16 Oct 2012 02:39:21 +0000 (02:39 +0000)]
Add a new ABI plugin method which specifies whether the architecture
must push something on the stack for a function call or not. In
x86, the stack pointer is decremented when the caller's pc is saved
on the stack. In arm, the stack pointer and frame pointer don't
necessarily have to change for a function call, although most
functions need to use some stack space during their execution.
Use this information in the RegisterContextLLDB to detect invalid
unwind scenarios more accurately.
<rdar://problem/
12348574>
llvm-svn: 166005
Craig Topper [Tue, 16 Oct 2012 02:21:30 +0000 (02:21 +0000)]
Fix filename in file header.
llvm-svn: 166004
Rafael Espindola [Tue, 16 Oct 2012 01:13:06 +0000 (01:13 +0000)]
Fix the cpu name and add -verify-machineinstrs.
llvm-svn: 166003
Jordan Rose [Tue, 16 Oct 2012 00:47:25 +0000 (00:47 +0000)]
[analyzer] ObjCContainersASTChecker: minor cleanup and an extra test case.
Follow-up to r165838, which fixed a potential crash.
llvm-svn: 166002
Andrew Trick [Tue, 16 Oct 2012 00:22:51 +0000 (00:22 +0000)]
misched: Added handleMove support for updating all kill flags, not just for allocatable regs.
This is a medium term workaround until we have a more robust solution
in the form of a register liveness utility for postRA passes.
llvm-svn: 166001
Jim Ingham [Tue, 16 Oct 2012 00:09:33 +0000 (00:09 +0000)]
Patch from Matt Kopec <matt.kopec@intel.com> to fix the problem that if two breakpoints were set on consecutive addresses, the continue from the
first breakpoint would skip the second.
llvm-svn: 166000
Jakob Stoklund Olesen [Tue, 16 Oct 2012 00:05:06 +0000 (00:05 +0000)]
Remove unused BitVectors from getAllocatableSet().
llvm-svn: 165999
Nadav Rotem [Mon, 15 Oct 2012 22:50:02 +0000 (22:50 +0000)]
LTO also needs to initialize the TargetTransform infrastructure.
llvm-svn: 165997
Anna Zaks [Mon, 15 Oct 2012 22:48:21 +0000 (22:48 +0000)]
[analyzer] CmpRuns - cleaned up the API, added relative path getter
llvm-svn: 165995
Anna Zaks [Mon, 15 Oct 2012 22:48:19 +0000 (22:48 +0000)]
[analyzer] Embed the analyzer version into the plist output.
llvm-svn: 165994
Anna Zaks [Mon, 15 Oct 2012 22:48:17 +0000 (22:48 +0000)]
[analyzer] Enhance the error message.
llvm-svn: 165993
Anna Zaks [Mon, 15 Oct 2012 22:48:14 +0000 (22:48 +0000)]
[analyzer] Do not warn on direct ivar assignments within copy methods.
llvm-svn: 165992
Greg Clayton [Mon, 15 Oct 2012 22:42:16 +0000 (22:42 +0000)]
Added "process plugin packet send" and "process plugin packet history" for GDB remote. "process plugin packet send" will send a packet and receive a response. "process plugin packet history" will dump the packet history buffer.
llvm-svn: 165991
Jakob Stoklund Olesen [Mon, 15 Oct 2012 22:41:03 +0000 (22:41 +0000)]
Remove RegisterClassInfo::isReserved() and isAllocatable().
Clients can use the equivalent functions in MRI.
llvm-svn: 165990
Michael Liao [Mon, 15 Oct 2012 22:39:43 +0000 (22:39 +0000)]
Add __builtin_setjmp/_longjmp supprt in X86 backend
- Besides used in SjLj exception handling, __builtin_setjmp/__longjmp is also
used as a light-weight replacement of setjmp/longjmp which are used to
implementation continuation, user-level threading, and etc. The support added
in this patch ONLY addresses this usage and is NOT intended to support SjLj
exception handling as zero-cost DWARF exception handling is used by default
in X86.
llvm-svn: 165989
Daniel Dunbar [Mon, 15 Oct 2012 22:23:53 +0000 (22:23 +0000)]
Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.
llvm-svn: 165988
Daniel Dunbar [Mon, 15 Oct 2012 22:23:34 +0000 (22:23 +0000)]
platform/clang_darwin: Drop an x86_64 slice into cc_kext_ios5.
- This doesn't get used, but it is a simple workaround for PR14013.
llvm-svn: 165987
Daniel Dunbar [Mon, 15 Oct 2012 22:23:32 +0000 (22:23 +0000)]
Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.
llvm-svn: 165986
Jakob Stoklund Olesen [Mon, 15 Oct 2012 22:14:34 +0000 (22:14 +0000)]
Remove LIS::isAllocatable() and isReserved() helpers.
All callers can simply use the corresponding MRI functions.
llvm-svn: 165985
Owen Anderson [Mon, 15 Oct 2012 22:05:27 +0000 (22:05 +0000)]
Add range-based set()/reset() to BitVector. These allow fast setting/resetting of ranges of bits, particularly useful when dealing with very large BitVector's.
llvm-svn: 165984
Jakob Stoklund Olesen [Mon, 15 Oct 2012 21:57:41 +0000 (21:57 +0000)]
Switch most getReservedRegs() clients to the MRI equivalent.
Using the cached bit vector in MRI avoids comstantly allocating and
recomputing the reserved register bit vector.
llvm-svn: 165983
Jakob Stoklund Olesen [Mon, 15 Oct 2012 21:33:06 +0000 (21:33 +0000)]
Freeze the reserved registers as soon as isel is complete.
Also provide an MRI::getReservedRegs() function to access the frozen
register set, and isReserved() and isAllocatable() methods to test
individual registers.
The various implementations of TRI::getReservedRegs() are quite
complicated, and many passes need to look at the reserved register set.
This patch makes it possible for these passes to use the cached copy in
MRI, avoiding a lot of malloc traffic and repeated calculations.
llvm-svn: 165982
Jim Grosbach [Mon, 15 Oct 2012 21:23:40 +0000 (21:23 +0000)]
ARM: v1i64 and v2i64 VBSL intrinsic support.
rdar://
12502028
llvm-svn: 165981
Greg Clayton [Mon, 15 Oct 2012 21:17:37 +0000 (21:17 +0000)]
Build with SDKROOT = macosx for "Debug" "DebugClang" and "Release" builds when building with Xcode.
llvm-svn: 165980
Greg Clayton [Mon, 15 Oct 2012 21:16:43 +0000 (21:16 +0000)]
Fixed a logic error that showed up when compiling with a newer version of clang where:
lldb::BasicType
ClangASTContext::GetLLDBBasicTypeEnumeration (clang_type_t clang_type)
would return a bogus value.
llvm-svn: 165979
David Blaikie [Mon, 15 Oct 2012 21:11:46 +0000 (21:11 +0000)]
Add dependency on llvm-bcanalyzer from tests to the CMake build.
This fixes a CMake build break introduced by r165739.
Thanks Jan Voung for the quick suggestion/fix.
llvm-svn: 165978
Abramo Bagnara [Mon, 15 Oct 2012 21:08:58 +0000 (21:08 +0000)]
Fixed CXXNamedCast right paren location propagation to instantiations.
llvm-svn: 165977
Abramo Bagnara [Mon, 15 Oct 2012 21:07:44 +0000 (21:07 +0000)]
Fixed LabelDecl source range.
llvm-svn: 165976
Abramo Bagnara [Mon, 15 Oct 2012 21:06:42 +0000 (21:06 +0000)]
Fixed ClassTemplateSpecializationDecl source range.
llvm-svn: 165975
Abramo Bagnara [Mon, 15 Oct 2012 21:05:46 +0000 (21:05 +0000)]
Fixed FunctionTypeLoc range for trailing return type.
llvm-svn: 165974
Fariborz Jahanian [Mon, 15 Oct 2012 20:57:52 +0000 (20:57 +0000)]
Fixes location of overriding declaration with no comment
of their own.
llvm-svn: 165972
Greg Clayton [Mon, 15 Oct 2012 20:39:39 +0000 (20:39 +0000)]
Patch from Daniel Malea -- Updated build instructions for Linux.
llvm-svn: 165964
Nico Weber [Mon, 15 Oct 2012 20:37:13 +0000 (20:37 +0000)]
Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
See PR14013.
llvm-svn: 165963
Nico Weber [Mon, 15 Oct 2012 20:37:01 +0000 (20:37 +0000)]
Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
See PR14013.
llvm-svn: 165962
Bill Wendling [Mon, 15 Oct 2012 20:36:26 +0000 (20:36 +0000)]
Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
llvm-svn: 165961
Bill Wendling [Mon, 15 Oct 2012 20:35:56 +0000 (20:35 +0000)]
Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
llvm-svn: 165960
Andrew Trick [Mon, 15 Oct 2012 20:33:14 +0000 (20:33 +0000)]
Check output of the misched unit tests
llvm-svn: 165959
Bill Wendling [Mon, 15 Oct 2012 19:58:25 +0000 (19:58 +0000)]
Add comments.
llvm-svn: 165958
Chad Rosier [Mon, 15 Oct 2012 19:56:10 +0000 (19:56 +0000)]
[ms-inline asm] Rework the front-end to use the API introduced in r165946.
-The front-end now builds a single assembly string and feeds it to the
AsmParser. The front-end iterates on a per statement basis by calling the
ParseStatement() function. Please note, the calling of ParseStatement() and
and any notion of MCAsmParsedOperands will be sunk into the MC layer in the
near future. I plan to expose more basic APIs such as getClobbers, etc.
-The enumeration of the AsmString expressions have been reworked to use SMLocs
rather than assembly Pieces, which were being parsed in the front-end.
-The test case, t8(), was modified due to r129223. I'll have to find a way to
work around things such as these.
Sorry for the large commit, but breaking this in multiple smaller commits proved
too irritating.
llvm-svn: 165957
Rafael Espindola [Mon, 15 Oct 2012 19:25:43 +0000 (19:25 +0000)]
Add a cpu to try to fix the atom builder.
llvm-svn: 165956
Chad Rosier [Mon, 15 Oct 2012 19:08:18 +0000 (19:08 +0000)]
[ms-inline asm] If we parsed a statement and the opcode is valid, then it's an instruction.
llvm-svn: 165955
Rafael Espindola [Mon, 15 Oct 2012 19:00:10 +0000 (19:00 +0000)]
Add testcase for pr14088.
llvm-svn: 165954
Fariborz Jahanian [Mon, 15 Oct 2012 18:58:50 +0000 (18:58 +0000)]
structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration.
// rdar://
12378793
llvm-svn: 165953
Andrew Trick [Mon, 15 Oct 2012 18:21:08 +0000 (18:21 +0000)]
misched tests: add a triple to speculatively fix windows builders.
llvm-svn: 165952
Rafael Espindola [Mon, 15 Oct 2012 18:21:07 +0000 (18:21 +0000)]
Make sure we iterate over newly created instructions. Fixes pr13625. Testcase to
follow in one sec.
llvm-svn: 165951
Andrew Trick [Mon, 15 Oct 2012 18:02:27 +0000 (18:02 +0000)]
misched: ILP scheduler for experimental heuristics.
llvm-svn: 165950
Argyrios Kyrtzidis [Mon, 15 Oct 2012 17:34:53 +0000 (17:34 +0000)]
Add an entry in CREDITS.TXT
llvm-svn: 165949
Chad Rosier [Mon, 15 Oct 2012 17:26:38 +0000 (17:26 +0000)]
[ms-inline asm] Update the end loc for ParseIntelMemOperand.
llvm-svn: 165947
Chad Rosier [Mon, 15 Oct 2012 17:19:13 +0000 (17:19 +0000)]
[ms-inline asm] Add a few new APIs to the AsmParser class in support of MS-Style
inline assembly. For the time being, these will be called directly by clang.
However, in the near future I expect these to be sunk back into the MC layer
and more basic APIs (e.g., getClobbers(), getConstraints(), etc.) will be called
by clang.
llvm-svn: 165946
Chad Rosier [Mon, 15 Oct 2012 16:50:34 +0000 (16:50 +0000)]
[ms-inline asm] Use incoming argument rather than hard coding to false.
llvm-svn: 165945
Jan Wen Voung [Mon, 15 Oct 2012 16:47:58 +0000 (16:47 +0000)]
Fix a typo in bitcode docs, from 165814.
llvm-svn: 165944
Douglas Gregor [Mon, 15 Oct 2012 16:45:32 +0000 (16:45 +0000)]
Teach TargetInfo to hold on to the TargetOptions with which it was
created.
llvm-svn: 165943
Micah Villmow [Mon, 15 Oct 2012 16:24:29 +0000 (16:24 +0000)]
Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis.
llvm-svn: 165941
Adhemerval Zanella [Mon, 15 Oct 2012 15:43:14 +0000 (15:43 +0000)]
PowerPC: add EmitTCEntry class for TOC creation
This patch replaces the EmitRawText by a EmitTCEntry class (specialized for
each Streamer) in PowerPC64 TOC entry creation.
llvm-svn: 165940
Alexander Potapenko [Mon, 15 Oct 2012 15:34:41 +0000 (15:34 +0000)]
Implement internal_memmove.
Use internal_memmove() and internal_memcpy() in the memcpy() and memmove() wrappers
when building the dynamic runtime (OS X only), to work around a bug in resolver functions wrapping.
See also http://code.google.com/p/address-sanitizer/issues/detail?id=116
llvm-svn: 165939
Kostya Serebryany [Mon, 15 Oct 2012 14:30:30 +0000 (14:30 +0000)]
[asan] fix a test
llvm-svn: 165938
Kostya Serebryany [Mon, 15 Oct 2012 14:22:56 +0000 (14:22 +0000)]
[asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. clang part: for FunctionPass we need to run asan at a different point, otherwise it will run before inlining
llvm-svn: 165937
Kostya Serebryany [Mon, 15 Oct 2012 14:20:06 +0000 (14:20 +0000)]
[asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. This will simplify chaining other FunctionPasses with asan. Also some minor cleanup
llvm-svn: 165936
Kostya Serebryany [Mon, 15 Oct 2012 13:30:38 +0000 (13:30 +0000)]
[asan] fix more tests
llvm-svn: 165934
Daniel Jasper [Mon, 15 Oct 2012 13:12:24 +0000 (13:12 +0000)]
Only report first error when no compilation database is found.
Review: http://llvm-reviews.chandlerc.com/D62
llvm-svn: 165933
Kostya Serebryany [Mon, 15 Oct 2012 13:04:58 +0000 (13:04 +0000)]
[asan] change the asan output slightly to avoid user confusion: a) add ':' after 'AddressSanitizer' and b) changed 'crashed' to 'SEGV'
llvm-svn: 165932
Chandler Carruth [Mon, 15 Oct 2012 10:24:43 +0000 (10:24 +0000)]
Update the memcpy rewriting to fully support widened int rewriting. This
includes extracting ints for copying elsewhere and inserting ints when
copying into the alloca. This should fix the CanSROA assertion coming
out of Clang's regression test suite.
llvm-svn: 165931
Chandler Carruth [Mon, 15 Oct 2012 10:24:40 +0000 (10:24 +0000)]
Follow-up fix to r165928: handle memset rewriting for widened integers,
and generally clean up the memset handling. It had rotted a bit as the
other rewriting logic got polished more.
llvm-svn: 165930
Silviu Baranga [Mon, 15 Oct 2012 09:41:32 +0000 (09:41 +0000)]
Fixed PR13938: the ARM backend was crashing because it couldn't select a VDUPLANE node with the vector input size different from the output size. This was bacause the BUILD_VECTOR lowering code didn't check that the size of the input vector was correct for using VDUPLANE.
llvm-svn: 165929
Chandler Carruth [Mon, 15 Oct 2012 08:40:30 +0000 (08:40 +0000)]
First major step toward addressing PR14059. This teaches SROA to handle
cases where we have partial integer loads and stores to an otherwise
promotable alloca to widen[1] those loads and stores to cover the entire
alloca and bitcast them into the appropriate type such that promotion
can proceed.
These partial loads and stores stem from an annoying confluence of ARM's
calling convention and ABI lowering and the FCA pre-splitting which
takes place in SROA. Clang lowers a { double, double } in-register
function argument as a [4 x i32] function argument to ensure it is
placed into integer 32-bit registers (a really unnerving implicit
contract between Clang and the ARM backend I would add). This results in
a FCA load of [4 x i32]* from the { double, double } alloca, and SROA
decomposes this into a sequence of i32 loads and stores. Inlining
proceeds, code gets folded, but at the end of the day, we still have i32
stores to the low and high halves of a double alloca. Widening these to
be i64 operations, and bitcasting them to double prior to loading or
storing allows promotion to proceed for these allocas.
I looked quite a bit changing the IR which Clang produces for this case
to be more friendly, but small changes seem unlikely to help. I think
the best representation we could use currently would be to pass 4 i32
arguments thereby avoiding any FCAs, but that would still require this
fix. It seems like it might eventually be nice to somehow encode the ABI
register selection choices outside of the parameter type system so that
the parameter can be a { double, double }, but the CC register
annotations indicate that this should be passed via 4 integer registers.
This patch does not address the second problem in PR14059, which is the
reverse: when a struct alloca is loaded as a *larger* single integer.
This patch also does not address some of the code quality issues with
the FCA-splitting. Those don't actually impede any optimizations really,
but they're on my list to clean up.
[1]: Pedantic footnote: for those concerned about memory model issues
here, this is safe. For the alloca to be promotable, it cannot escape or
have any use of its address that could allow these loads or stores to be
racing. Thus, widening is always safe.
llvm-svn: 165928
Chandler Carruth [Mon, 15 Oct 2012 08:40:22 +0000 (08:40 +0000)]
Hoist the canConvertValue predicate and the convertValue transform out
into static helper functions. They're really quite generic and are going
to be needed elsewhere shortly.
llvm-svn: 165927
Bill Wendling [Mon, 15 Oct 2012 07:31:59 +0000 (07:31 +0000)]
Use enum values instead of magic numbers for indexing into the attribute list.
llvm-svn: 165925
Bill Wendling [Mon, 15 Oct 2012 07:29:08 +0000 (07:29 +0000)]
Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
llvm-svn: 165924
Bill Wendling [Mon, 15 Oct 2012 06:53:28 +0000 (06:53 +0000)]
Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
llvm-svn: 165923
Bill Wendling [Mon, 15 Oct 2012 06:34:18 +0000 (06:34 +0000)]
Supply a default 'operator=' method.
llvm-svn: 165922
Douglas Gregor [Mon, 15 Oct 2012 06:28:11 +0000 (06:28 +0000)]
Introduce the notion of excluded headers into the module map
description. Previously, one could emulate this behavior by placing
the header in an always-unavailable submodule, but Argyrios guilted me
into expressing this idea properly.
llvm-svn: 165921
Bill Wendling [Mon, 15 Oct 2012 05:40:12 +0000 (05:40 +0000)]
Move the AttributesImpl header file into the VMCore directory so that it can be opaque.
llvm-svn: 165920
Bill Wendling [Mon, 15 Oct 2012 04:47:45 +0000 (04:47 +0000)]
Attributes Rewrite
Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.
llvm-svn: 165918