Nadav Rotem [Mon, 15 Oct 2012 22:50:02 +0000 (22:50 +0000)]
LTO also needs to initialize the TargetTransform infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165997
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165990
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165989
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165985
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165984
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165983
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165982
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 15 Oct 2012 21:23:40 +0000 (21:23 +0000)]
ARM: v1i64 and v2i64 VBSL intrinsic support.
rdar://
12502028
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165981
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165978
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Mon, 15 Oct 2012 20:33:14 +0000 (20:33 +0000)]
Check output of the misched unit tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165959
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 15 Oct 2012 19:58:25 +0000 (19:58 +0000)]
Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165958
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Oct 2012 19:25:43 +0000 (19:25 +0000)]
Add a cpu to try to fix the atom builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165956
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165955
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Oct 2012 19:00:10 +0000 (19:00 +0000)]
Add testcase for pr14088.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165954
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Mon, 15 Oct 2012 18:21:08 +0000 (18:21 +0000)]
misched tests: add a triple to speculatively fix windows builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165952
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165951
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Mon, 15 Oct 2012 18:02:27 +0000 (18:02 +0000)]
misched: ILP scheduler for experimental heuristics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165950
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 15 Oct 2012 17:26:38 +0000 (17:26 +0000)]
[ms-inline asm] Update the end loc for ParseIntelMemOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165947
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165946
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165945
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Wen Voung [Mon, 15 Oct 2012 16:47:58 +0000 (16:47 +0000)]
Fix a typo in bitcode docs, from 165814.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165944
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165941
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165940
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Mon, 15 Oct 2012 14:30:30 +0000 (14:30 +0000)]
[asan] fix a test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165938
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165936
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165931
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165930
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165929
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165928
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165927
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165924
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165923
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 15 Oct 2012 06:34:18 +0000 (06:34 +0000)]
Supply a default 'operator=' method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165922
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165920
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 15 Oct 2012 04:46:55 +0000 (04:46 +0000)]
Attributes Rewrite
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Mon, 15 Oct 2012 03:47:37 +0000 (03:47 +0000)]
instcombine: Migrate strcmp and strncmp optimizations
This patch migrates the strcmp and strncmp optimizations from the
simplify-libcalls pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165915
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 16:06:09 +0000 (16:06 +0000)]
Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165908
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 15:56:39 +0000 (15:56 +0000)]
Fix a typo that made ImmutableMap::getMaxElement() useless.
Add a basic unit test for ImmutableMap. Found by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165907
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 11:15:42 +0000 (11:15 +0000)]
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165904
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 10:21:31 +0000 (10:21 +0000)]
Unquadratize SetVector removal loops in DSE.
Erasing from the beginning or middle of the vector is expensive, remove_if can
do it in linear time even though it's a bit ugly without lambdas.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165903
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 09:21:44 +0000 (09:21 +0000)]
Remove dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165902
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 08:54:26 +0000 (08:54 +0000)]
Remove operator cast method in favor of querying with the correct method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165899
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Oct 2012 08:48:40 +0000 (08:48 +0000)]
Fix use after free when deleting attributes in a chained folding set.
Can't follow the intrusive linked list when the element is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165898
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 08:25:35 +0000 (08:25 +0000)]
Don't use the new syntax just yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165897
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 07:52:48 +0000 (07:52 +0000)]
Remove the bitwise AND operators from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165896
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 07:35:59 +0000 (07:35 +0000)]
Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165895
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 07:17:34 +0000 (07:17 +0000)]
Remove the bitwise OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165894
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 06:56:13 +0000 (06:56 +0000)]
Remove the bitwise XOR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165893
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 06:39:53 +0000 (06:39 +0000)]
Remove the bitwise NOT operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165892
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 04:10:01 +0000 (04:10 +0000)]
Decode the LLVM attributes from bitcode using the attributes builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165891
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 03:58:29 +0000 (03:58 +0000)]
Use builder to create alignment attributes. Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165890
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 03:28:43 +0000 (03:28 +0000)]
Remove dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165889
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 14 Oct 2012 03:27:15 +0000 (03:27 +0000)]
Don't pass in an Attributes object to something that expects an integral value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165887
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Oct 2012 18:03:34 +0000 (18:03 +0000)]
Remove unused private field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165881
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Oct 2012 17:38:00 +0000 (17:38 +0000)]
X86: Depending on the local semantics of .align this test can also emit a nopl instead of nopw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165880
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Sat, 13 Oct 2012 17:34:49 +0000 (17:34 +0000)]
Documentation: Lexicon.rst: add "BB Vectorization" and "TBAA".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165879
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Oct 2012 17:28:35 +0000 (17:28 +0000)]
X86: Disable long nops for all cpus prior to pentiumpro/i686.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165878
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 13 Oct 2012 17:26:47 +0000 (17:26 +0000)]
Drop <def,dead> flags when merging into an unused lane.
The new coalescer can merge a dead def into an unused lane of an
otherwise live vector register.
Clear the <dead> flag when that happens since the flag refers to the
full virtual register which is still live after the partial dead def.
This fixes PR14079.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165877
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Sat, 13 Oct 2012 16:45:37 +0000 (16:45 +0000)]
instcombine: Migrate strchr and strrchr optimizations
This patch migrates the strchr and strrchr optimizations from the
simplify-libcalls pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165875
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Sat, 13 Oct 2012 16:45:32 +0000 (16:45 +0000)]
instcombine: Migrate strcat and strncat optimizations
This patch migrates the strcat and strncat optimizations from the
simplify-libcalls pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165874
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Sat, 13 Oct 2012 16:45:24 +0000 (16:45 +0000)]
Implement new LibCallSimplifier class
This patch implements the new LibCallSimplifier class as outlined in [1].
In addition to providing the new base library simplification infrastructure,
all the fortified library call simplifications were moved over to the new
infrastructure. The rest of the library simplification optimizations will
be moved over with follow up patches.
NOTE: The original fortified library call simplifier located in the
SimplifyFortifiedLibCalls class was not removed because it is still
used by CodeGenPrepare. This class will eventually go away too.
[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-August/052283.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165873
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 13 Oct 2012 16:15:31 +0000 (16:15 +0000)]
Allow for loops in LiveIntervals::pruneValue().
It is possible that the live range of the value being pruned loops back
into the kill MBB where the search started. When that happens, make sure
that the beginning of KillMBB is also pruned.
Instead of starting a DFS at KillMBB and skipping the root of the
search, start a DFS at each KillMBB successor, and allow the search to
loop back to KillMBB.
This fixes PR14078.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165872
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Oct 2012 12:50:19 +0000 (12:50 +0000)]
X86: Fix accidentally swapped operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165871
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 13 Oct 2012 10:49:33 +0000 (10:49 +0000)]
Teach SROA to cope with wrapper aggregates. These show up a lot in ABI
type coercion code, especially when targetting ARM. Things like [1
x i32] instead of i32 are very common there.
The goal of this logic is to ensure that when we are picking an alloca
type, we look through such wrapper aggregates and across any zero-length
aggregate elements to find the simplest type possible to form a type
partition.
This logic should (generally speaking) rarely fire. It only ends up
kicking in when an alloca is accessed using two different types (for
instance, i32 and float), and the underlying alloca type has wrapper
aggregates around it. I noticed a significant amount of this occurring
looking at stepanov_abstraction generated code for arm, and suspect it
happens elsewhere as well.
Note that this doesn't yet address truly heinous IR productions such as
PR14059 is concerning. Those result in mismatched *sizes* of types in
addition to mismatched access and alloca types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165870
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 13 Oct 2012 10:49:30 +0000 (10:49 +0000)]
Speculatively harden the conversion logic. I have no idea if this will
help the dragonegg builders, and no test case at this point, but this
was one dimly plausible case I spotted by inspection. Hopefully will get
a testcase from those bots soon-ish, and will tidy this up with proper
testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165869
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Oct 2012 10:39:49 +0000 (10:39 +0000)]
X86: Promote i8 cmov when both operands are coming from truncates of the same width.
X86 doesn't have i8 cmovs so isel would emit a branch. Emitting branches at this
level is often not a good idea because it's too late for many optimizations to
kick in. This solution doesn't add any extensions (truncs are free) and tries
to avoid introducing partial register stalls by filtering direct copyfromregs.
I'm seeing a ~10% speedup on reading a random .png file with libpng15 via
graphicsmagick on x86_64/westmere, but YMMV depending on the microarchitecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165868
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 13 Oct 2012 05:09:27 +0000 (05:09 +0000)]
Silence a warning in -assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165867
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 13 Oct 2012 02:41:05 +0000 (02:41 +0000)]
Clean up how we rewrite loads and stores to the whole alloca. When these
are single value types, the load and store should be directly based upon
the alloca and then bitcasting can fix the type as needed afterward.
This might in theory improve some of the IR coming out of SROA, but
I don't expect big changes yet and don't have any test cases on hand.
This is really just a cleanup/refactoring patch. The next patch will
cause this code path to be hit a lot more, actually get SROA to promote
more allocas and include several more test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165864
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 13 Oct 2012 00:26:04 +0000 (00:26 +0000)]
[ms-inline asm] Remove the MatchInstruction() function. Previously, this was
the interface between the front-end and the MC layer when parsing inline
assembly. Unfortunately, this is too deep into the parsing stack. Specifically,
we're unable to handle target-independent assembly (i.e., assembly directives,
labels, etc.). Note the MatchAndEmitInstruction() isn't the correct
abstraction either. I'll be exposing target-independent hooks shortly, so this
is really just a cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165858
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 12 Oct 2012 23:53:16 +0000 (23:53 +0000)]
Check section type rather than assuming it's code when emitting sections while processing relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165854
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 12 Oct 2012 23:39:43 +0000 (23:39 +0000)]
ARM: tail-call inside a function where part of a byval argument is on caller's
local frame causes problem.
For example:
void f(StructToPass s) {
g(&s, sizeof(s));
}
will cause problem with tail-call since part of s is passed via registers and
saved in f's local frame. When g tries to access s, part of s may be corrupted
since f's local frame is popped out before the tail-call.
The current fix is to disable tail-call if getVarArgsRegSaveSize is not 0 for
the caller. This is a conservative approach, if we can prove the address of
s or part of s is not taken and passed to g, it should be okay to perform
tail-call.
rdar://
12442472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165853
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 23:09:25 +0000 (23:09 +0000)]
[ms-inline asm] Capitalize per coding standard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165847
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 12 Oct 2012 23:01:33 +0000 (23:01 +0000)]
Fix buildbots: -misched=shuffle is only available in +Asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165846
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 12 Oct 2012 22:59:21 +0000 (22:59 +0000)]
ARM: Mark VSELECT as 'expand'.
The backend already pattern matches to form VBSL when it can. We may want to
teach it to use the vbsl intrinsics at some point to prevent machine licm from
mucking with this, but using the Expand is completely correct.
http://llvm.org/bugs/show_bug.cgi?id=13831
http://llvm.org/bugs/show_bug.cgi?id=13961
Patch by Peter Couperus <peter.couperus@st.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165845
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 22:53:36 +0000 (22:53 +0000)]
[ms-inline asm] Use the new API introduced in r165830 in lieu of the
MapAndConstraints vector. Also remove the unused Kind argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165833
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Oct 2012 22:15:11 +0000 (22:15 +0000)]
[ms-inline asm] Add a few data members and member functions to the
MCParsedAsmOperand class in support of ms-style inline assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165830
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Fri, 12 Oct 2012 21:48:14 +0000 (21:48 +0000)]
Use MACOSX_DEPLOYMENT_TARGET when it is set. <rdar://problem/
12433905>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165828
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 12 Oct 2012 21:47:49 +0000 (21:47 +0000)]
Correcting enum values mentioned in comments.
Patch by Ashok Thirumurthi.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165827
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 12 Oct 2012 21:31:57 +0000 (21:31 +0000)]
Use a transposed algorithm for handleMove().
Completely update one interval at a time instead of collecting live
range fragments to be updated. This avoids building data structures,
except for a single SmallPtrSet of updated intervals.
Also share code between handleMove() and handleMoveIntoBundle().
Add support for moving dead defs across other live values in the
interval. The MI scheduler can do that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165824
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Wen Voung [Fri, 12 Oct 2012 18:13:17 +0000 (18:13 +0000)]
Add bitcode instruction encoding documentation for module version
0 and 1. Followup to 165739.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165814
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 12 Oct 2012 18:03:04 +0000 (18:03 +0000)]
Fix coalescing with IMPLICIT_DEF values.
PHIElimination inserts IMPLICIT_DEF instructions to guarantee that all
PHI predecessors have a live-out value. These IMPLICIT_DEF values are
not considered to be real interference when coalescing virtual
registers:
%vreg1 = IMPLICIT_DEF
%vreg2 = MOV32r0
When joining %vreg1 and %vreg2, the IMPLICIT_DEF instruction and its
value number should simply be erased since the %vreg2 value number now
provides a live-out value for the PHI predecesor block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165813
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Fri, 12 Oct 2012 17:57:35 +0000 (17:57 +0000)]
Change (!list.size() == 0) to (!list.empty()). No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165812
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Fri, 12 Oct 2012 17:39:25 +0000 (17:39 +0000)]
Set default CPU for Darwin targets with LTO. <rdar://problem/
12457841>
This is a temporary hack until Bill's project to record command line options
in the LLVM IR is ready. Clang currently sets a default CPU but that isn't
recorded anywhere and it doesn't get used in the final LTO compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165809
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 16:01:08 +0000 (16:01 +0000)]
llvm/test/CodeGen/PowerPC/2012-10-12-bitcast.ll: Try to fix failure on non-ppc hosts, to add -mattr=+altivec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165803
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 12 Oct 2012 15:42:58 +0000 (15:42 +0000)]
Fix big-endian codegen bug in DAGTypeLegalizer::ExpandRes_BITCAST
On PowerPC, a bitcast of <16 x i8> to i128 may run through a code
path in ExpandRes_BITCAST that attempts to do an intermediate
bitcast to a <4 x i32> vector, and then construct the Hi and Lo parts
of the resulting i128 by pairing up two of those i32 vector elements
each. The code already recognizes that on a big-endian system, the
first two vector elements form the Hi part, and the final two vector
elements form the Lo part (vice-versa from the little-endian situation).
However, we also need to take endianness into account when forming each
of those separate pairs: on a big-endian system, vector element 0 is
the *high* part of the pair making up the Hi part of the result, and
vector element 1 is the low part of the pair. The code currently always
uses vector element 0 as the low part and vector element 1 as the high
part, as is appropriate for little-endian platforms only.
This patch fixes this by swapping the vector elements as they are
paired up as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165802
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 14:11:48 +0000 (14:11 +0000)]
ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165796
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 14:11:43 +0000 (14:11 +0000)]
ExceptionDemo.cpp: Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165795
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 12 Oct 2012 11:08:57 +0000 (11:08 +0000)]
Add powerpc-ibm-aix to Triple. Patch by Kai.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165792
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 12 Oct 2012 09:55:13 +0000 (09:55 +0000)]
Add float-abi and softfloat options to lli
Patch by Amara Emerson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165791
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 08:09:29 +0000 (08:09 +0000)]
JITTest.cpp: Use LLVM_ATTRIBUTE_USED, rather than __attribute__ directly!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165790
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 12 Oct 2012 04:28:25 +0000 (04:28 +0000)]
Shuffle the virtual destructor down to the base. This should actually pacify
-Wnon-virtual-dtor for real.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165787
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 12 Oct 2012 04:13:25 +0000 (04:13 +0000)]
Give this class full of virtual functions a virtual destructor. Classes love
virtual destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165786
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 12 Oct 2012 02:04:47 +0000 (02:04 +0000)]
Indenting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165785
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Fri, 12 Oct 2012 02:04:32 +0000 (02:04 +0000)]
fix warning
DependenceAnalysis.cpp:1164:32: warning: implicit truncation from 'int' to bitfield changes value from -5 to 3
[-Wconstant-conversion]
Result.DV[Level].Direction &= ~Dependence::DVEntry::GT;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
Patch from Preston Briggs <preston.briggs@gmail.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165784
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 12 Oct 2012 02:01:09 +0000 (02:01 +0000)]
Div, Rem int/unsigned int
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165783
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 12 Oct 2012 01:55:51 +0000 (01:55 +0000)]
docs: Update example to conform to coding standards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165782
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 12 Oct 2012 01:44:08 +0000 (01:44 +0000)]
Mark function as 'used' so that LTO doesn't try to get rid of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165781
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 01:34:07 +0000 (01:34 +0000)]
Revert r165777, "Mark function as 'used' so that LTO doesn't try to get rid of it."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165780
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 12 Oct 2012 01:21:24 +0000 (01:21 +0000)]
docs: Minor clean up of Phabricator documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165779
91177308-0d34-0410-b5e6-
96231b3b80d8