Commit Graph

85732 Commits

Author SHA1 Message Date
Craig Topper 2a3f77585f Move X86MCInstLower class definition into implementation file. It's not needed outside.
llvm-svn: 166014
2012-10-16 06:01:50 +00:00
Bill Wendling a529ade5a4 Cleanup whitespace.
llvm-svn: 166013
2012-10-16 06:01:44 +00:00
Bill Wendling 147ee8e34f Have AttributesImpl defriend the Attributes class.
llvm-svn: 166012
2012-10-16 05:57:28 +00:00
Bill Wendling 3ffbac4432 Have AttrBuilder defriend the Attributes class.
llvm-svn: 166011
2012-10-16 05:55:09 +00:00
Bill Wendling c6a15cf519 Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.
llvm-svn: 166009
2012-10-16 05:23:31 +00:00
Bill Wendling a517c30ed3 Put simple c'tors inline.
llvm-svn: 166008
2012-10-16 05:22:28 +00:00
Bill Wendling 4f69e1483b Pass in the context to the Attributes::get method.
llvm-svn: 166007
2012-10-16 05:20:51 +00:00
Craig Topper c74b600afb Fix filename in file header.
llvm-svn: 166004
2012-10-16 02:21:30 +00:00
Rafael Espindola 7f4f79a5bc Fix the cpu name and add -verify-machineinstrs.
llvm-svn: 166003
2012-10-16 01:13:06 +00:00
Andrew Trick d9d4be0d57 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
2012-10-16 00:22:51 +00:00
Jakob Stoklund Olesen 244beb42ce Remove unused BitVectors from getAllocatableSet().
llvm-svn: 165999
2012-10-16 00:05:06 +00:00
Nadav Rotem 8be2a9adba LTO also needs to initialize the TargetTransform infrastructure.
llvm-svn: 165997
2012-10-15 22:50:02 +00:00
Jakob Stoklund Olesen f67bf3e0ea Remove RegisterClassInfo::isReserved() and isAllocatable().
Clients can use the equivalent functions in MRI.

llvm-svn: 165990
2012-10-15 22:41:03 +00:00
Michael Liao 97bf363a9e 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
2012-10-15 22:39:43 +00:00
Jakob Stoklund Olesen cea596acf7 Remove LIS::isAllocatable() and isReserved() helpers.
All callers can simply use the corresponding MRI functions.

llvm-svn: 165985
2012-10-15 22:14:34 +00:00
Owen Anderson 6b7bdf88c9 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
2012-10-15 22:05:27 +00:00
Jakob Stoklund Olesen c30a9af2d7 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
2012-10-15 21:57:41 +00:00
Jakob Stoklund Olesen 57e310613c 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
2012-10-15 21:33:06 +00:00
Jim Grosbach 54c7432e22 ARM: v1i64 and v2i64 VBSL intrinsic support.
rdar://12502028

llvm-svn: 165981
2012-10-15 21:23:40 +00:00
David Blaikie 3bc98d94ad 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
2012-10-15 21:11:46 +00:00
Bill Wendling 50d27849f6 Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
llvm-svn: 165960
2012-10-15 20:35:56 +00:00
Andrew Trick 6e5f49d7b7 Check output of the misched unit tests
llvm-svn: 165959
2012-10-15 20:33:14 +00:00
Bill Wendling 6fe20085ac Add comments.
llvm-svn: 165958
2012-10-15 19:58:25 +00:00
Rafael Espindola aee00b5e72 Add a cpu to try to fix the atom builder.
llvm-svn: 165956
2012-10-15 19:25:43 +00:00
Chad Rosier f3bc599680 [ms-inline asm] If we parsed a statement and the opcode is valid, then it's an instruction.
llvm-svn: 165955
2012-10-15 19:08:18 +00:00
Rafael Espindola b41459a3c0 Add testcase for pr14088.
llvm-svn: 165954
2012-10-15 19:00:10 +00:00
Andrew Trick 5a89e0ef07 misched tests: add a triple to speculatively fix windows builders.
llvm-svn: 165952
2012-10-15 18:21:08 +00:00
Rafael Espindola 048405f510 Make sure we iterate over newly created instructions. Fixes pr13625. Testcase to
follow in one sec.

llvm-svn: 165951
2012-10-15 18:21:07 +00:00
Andrew Trick 90f711da9a misched: ILP scheduler for experimental heuristics.
llvm-svn: 165950
2012-10-15 18:02:27 +00:00
Chad Rosier 499d4a1468 [ms-inline asm] Update the end loc for ParseIntelMemOperand.
llvm-svn: 165947
2012-10-15 17:26:38 +00:00
Chad Rosier 0d6f149e62 [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
2012-10-15 17:19:13 +00:00
Chad Rosier ca0ada1aeb [ms-inline asm] Use incoming argument rather than hard coding to false.
llvm-svn: 165945
2012-10-15 16:50:34 +00:00
Jan Wen Voung 69082be39c Fix a typo in bitcode docs, from 165814.
llvm-svn: 165944
2012-10-15 16:47:58 +00:00
Micah Villmow 4bb926d91d Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis.
llvm-svn: 165941
2012-10-15 16:24:29 +00:00
Adhemerval Zanella ef206f19a4 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
2012-10-15 15:43:14 +00:00
Kostya Serebryany 19ab3d1f6a [asan] fix a test
llvm-svn: 165938
2012-10-15 14:30:30 +00:00
Kostya Serebryany b0e2506d97 [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
2012-10-15 14:20:06 +00:00
Chandler Carruth 49c8eea3c0 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
2012-10-15 10:24:43 +00:00
Chandler Carruth 9d966a2002 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
2012-10-15 10:24:40 +00:00
Silviu Baranga b14097000b 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
2012-10-15 09:41:32 +00:00
Chandler Carruth 435c4e0792 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
2012-10-15 08:40:30 +00:00
Chandler Carruth aa6afbb831 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
2012-10-15 08:40:22 +00:00
Bill Wendling fbd38fe2e3 Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
llvm-svn: 165924
2012-10-15 07:29:08 +00:00
Bill Wendling 79d45dbbf9 Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
llvm-svn: 165923
2012-10-15 06:53:28 +00:00
Bill Wendling 4ec54eeed6 Supply a default 'operator=' method.
llvm-svn: 165922
2012-10-15 06:34:18 +00:00
Bill Wendling 8c3e65db52 Move the AttributesImpl header file into the VMCore directory so that it can be opaque.
llvm-svn: 165920
2012-10-15 05:40:12 +00:00
Bill Wendling d079a446d7 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.

llvm-svn: 165917
2012-10-15 04:46:55 +00:00
Meador Inge 40b6fac36c 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.

llvm-svn: 165915
2012-10-15 03:47:37 +00:00
Benjamin Kramer b9a9273826 Update CMake build.
llvm-svn: 165908
2012-10-14 16:06:09 +00:00
Benjamin Kramer 43f2507fce Fix a typo that made ImmutableMap::getMaxElement() useless.
Add a basic unit test for ImmutableMap. Found by inspection.

llvm-svn: 165907
2012-10-14 15:56:39 +00:00