oota-llvm.git
12 years agoPPC32 uses R2 as the TLS register. Fix the copy and paste.
Roman Divacky [Tue, 5 Jun 2012 17:14:17 +0000 (17:14 +0000)]
PPC32 uses R2 as the TLS register. Fix the copy and paste.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158004 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntegersSubsetMapping: added exclude operation, that allows to exclude subset of...
Stepan Dyatkovskiy [Tue, 5 Jun 2012 07:57:36 +0000 (07:57 +0000)]
IntegersSubsetMapping: added exclude operation, that allows to exclude subset of integers from current mapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157989 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntegersSubsetMapping:
Stepan Dyatkovskiy [Tue, 5 Jun 2012 07:43:08 +0000 (07:43 +0000)]
IntegersSubsetMapping:
Changed type of Items collection: from std::vector to std::list.
Also some small fixes made in IntegersSubset.h, IntegersSubsetMapping.h and IntegersSubsetTest.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157987 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoX86 itinerary properties.
Andrew Trick [Tue, 5 Jun 2012 03:44:46 +0000 (03:44 +0000)]
X86 itinerary properties.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157981 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM itinerary properties.
Andrew Trick [Tue, 5 Jun 2012 03:44:43 +0000 (03:44 +0000)]
ARM itinerary properties.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157980 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomisched: Added MultiIssueItineraries.
Andrew Trick [Tue, 5 Jun 2012 03:44:40 +0000 (03:44 +0000)]
misched: Added MultiIssueItineraries.

This allows a subtarget to explicitly specify the issue width and
other properties without providing pipeline stage details for every
instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157979 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agosdsched: Use the right heuristics when -mcpu is not provided and we have no itinerary.
Andrew Trick [Tue, 5 Jun 2012 03:44:34 +0000 (03:44 +0000)]
sdsched: Use the right heuristics when -mcpu is not provided and we have no itinerary.
Use ILP heuristics for long latency instrs if no scoreboard exists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157978 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomisched: Allow disabling scoreboard hazard checking for subtargets with a
Andrew Trick [Tue, 5 Jun 2012 03:44:32 +0000 (03:44 +0000)]
misched: Allow disabling scoreboard hazard checking for subtargets with a
valid itinerary but no pipeline stages.

An itinerary can contain useful scheduling information without specifying pipeline stages for each instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157977 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agowhitespace
Andrew Trick [Tue, 5 Jun 2012 03:44:29 +0000 (03:44 +0000)]
whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157976 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomisched: comments from code review.
Andrew Trick [Tue, 5 Jun 2012 03:44:26 +0000 (03:44 +0000)]
misched: comments from code review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157975 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the last remat-related code from LiveIntervalAnalysis.
Jakob Stoklund Olesen [Tue, 5 Jun 2012 01:06:15 +0000 (01:06 +0000)]
Remove the last remat-related code from LiveIntervalAnalysis.

Rematerialization is handled by LiveRangeEdit now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157974 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStop using LiveIntervals::isReMaterializable().
Jakob Stoklund Olesen [Tue, 5 Jun 2012 01:06:12 +0000 (01:06 +0000)]
Stop using LiveIntervals::isReMaterializable().

It is an old function that does a lot more than required by
CalcSpillWeights, which was the only remaining caller.

The isRematerializable() function never actually sets the isLoad
argument, so don't try to compute that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157973 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert commit r157966
Joel Jones [Tue, 5 Jun 2012 00:47:21 +0000 (00:47 +0000)]
Revert commit r157966

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157972 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis change handles a another case for generating the bic instruction
Joel Jones [Mon, 4 Jun 2012 23:38:57 +0000 (23:38 +0000)]
This change handles a another case for generating the bic instruction
when a compile time constant is known.  This occurs when implicitly zero
extending function arguments from 16 bits to 32 bits.

<rdar://problem/11481151>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157966 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDelete dead code.
Jakob Stoklund Olesen [Mon, 4 Jun 2012 23:01:41 +0000 (23:01 +0000)]
Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157963 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen gvn decides to replace an instruction with another, we have to patch the
Rafael Espindola [Mon, 4 Jun 2012 22:44:21 +0000 (22:44 +0000)]
When gvn decides to replace an instruction with another, we have to patch the
replacement to make it at least as generic as the instruction being replaced.
This includes:
* dropping nsw/nuw flags
* getting the least restrictive tbaa and fpmath metadata
* merging ranges

Fixes PR12979.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157958 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch LiveIntervals member variable to LLVM naming standards.
Jakob Stoklund Olesen [Mon, 4 Jun 2012 22:39:14 +0000 (22:39 +0000)]
Switch LiveIntervals member variable to LLVM naming standards.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157957 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPass context pointers to LiveRangeCalc::reset().
Jakob Stoklund Olesen [Mon, 4 Jun 2012 18:21:16 +0000 (18:21 +0000)]
Pass context pointers to LiveRangeCalc::reset().

Remove the same pointers from all the other LiveRangeCalc functions,
simplifying the interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157941 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a test case for mips64 unaligned load/store instructions.
Akira Hatanaka [Mon, 4 Jun 2012 17:57:06 +0000 (17:57 +0000)]
Add a test case for mips64 unaligned load/store instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157939 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRename test/CodeGen/Mips/load-shift-left-right.ll.
Akira Hatanaka [Mon, 4 Jun 2012 17:50:36 +0000 (17:50 +0000)]
Rename test/CodeGen/Mips/load-shift-left-right.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157938 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a bug in MipsTargetLowering::LowerLOAD. A shift-right-logical node is
Akira Hatanaka [Mon, 4 Jun 2012 17:46:29 +0000 (17:46 +0000)]
Fix a bug in MipsTargetLowering::LowerLOAD. A shift-right-logical node is
inserted after the shift-left-logical node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157937 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement local-exec TLS on PowerPC.
Roman Divacky [Mon, 4 Jun 2012 17:36:38 +0000 (17:36 +0000)]
Implement local-exec TLS on PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157935 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMIPS TLS: use the model selected by TargetMachine::getTLSModel().
Hans Wennborg [Mon, 4 Jun 2012 14:02:08 +0000 (14:02 +0000)]
MIPS TLS: use the model selected by TargetMachine::getTLSModel().

This was mostly done already in r156162, but I missed one place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157929 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the "-promote-elements" flag. This flag is now enabled by default.
Nadav Rotem [Mon, 4 Jun 2012 11:27:21 +0000 (11:27 +0000)]
Remove the "-promote-elements" flag. This flag is now enabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157925 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBetter comments for TLS-related X86 MachineOperand flags.
Hans Wennborg [Mon, 4 Jun 2012 09:55:36 +0000 (09:55 +0000)]
Better comments for TLS-related X86 MachineOperand flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157920 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd intrinsic forms for FMA instructions to opcode folding tables.
Craig Topper [Mon, 4 Jun 2012 07:46:16 +0000 (07:46 +0000)]
Add intrinsic forms for FMA instructions to opcode folding tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157917 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agogetAllOnesValue also works for vectors of integers.
Duncan Sands [Mon, 4 Jun 2012 07:18:12 +0000 (07:18 +0000)]
getAllOnesValue also works for vectors of integers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157915 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd VFMADDSUB and VFMSUBADD FMA instructions to folding tables. Also add 213 forms...
Craig Topper [Mon, 4 Jun 2012 07:08:21 +0000 (07:08 +0000)]
Add VFMADDSUB and VFMSUBADD FMA instructions to folding tables. Also add 213 forms of scalar FMA instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157914 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a copy-and-paste duplication error in the PPC 440 and A2 schedules (no functional...
Hal Finkel [Mon, 4 Jun 2012 02:39:52 +0000 (02:39 +0000)]
Fix a copy-and-paste duplication error in the PPC 440 and A2 schedules (no functionality change).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157912 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable generating PPC pre-increment (r+imm) instructions by default.
Hal Finkel [Mon, 4 Jun 2012 02:21:00 +0000 (02:21 +0000)]
Enable generating PPC pre-increment (r+imm) instructions by default.

It seems that this no longer causes test suite failures on PPC64 (after r157159),
and often gives a performance benefit, so it can be enabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157911 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRepresent .rept as an anonymous macro. This removes the need for the ActiveRept
Rafael Espindola [Sun, 3 Jun 2012 23:57:14 +0000 (23:57 +0000)]
Represent .rept as an anonymous macro. This removes the need for the ActiveRept
vector. No functionality change.
Extracted from a patch by the PaX Team.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157909 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a typedef to simplify the code a bit. Not functionality change.
Rafael Espindola [Sun, 3 Jun 2012 22:41:23 +0000 (22:41 +0000)]
Add a typedef to simplify the code a bit. Not functionality change.
Part of a patch by the PaX Team.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157908 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRename FMA3 feature flag to just FMA to match gcc so it can be added to clang.
Craig Topper [Sun, 3 Jun 2012 18:58:46 +0000 (18:58 +0000)]
Rename FMA3 feature flag to just FMA to match gcc so it can be added to clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157903 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSimplify the fma4 renaming code.
Craig Topper [Sun, 3 Jun 2012 16:48:52 +0000 (16:48 +0000)]
Simplify the fma4 renaming code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157902 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntRange: Restore the copy constuctor explicitly to appase buildbot.
NAKAMURA Takumi [Sun, 3 Jun 2012 15:42:12 +0000 (15:42 +0000)]
IntRange: Restore the copy constuctor explicitly to appase buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157901 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAutoupgrade support the rename of x86.fma4 intrinsics to x86.fma from r157898.
Craig Topper [Sun, 3 Jun 2012 08:07:25 +0000 (08:07 +0000)]
Autoupgrade support the rename of x86.fma4 intrinsics to x86.fma from r157898.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157899 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRename fma4 intrinsics to just fma since they are now used for both FMA4 and FMA3...
Craig Topper [Sun, 3 Jun 2012 07:26:46 +0000 (07:26 +0000)]
Rename fma4 intrinsics to just fma since they are now used for both FMA4 and FMA3. Autoupgrade support coming in a separate commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157898 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r157831
Manman Ren [Sun, 3 Jun 2012 03:14:24 +0000 (03:14 +0000)]
Revert r157831

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157896 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse sse_load_f32/64 for scalar FMA3 intrinsic patterns instead of 128-bit loads to...
Craig Topper [Sun, 3 Jun 2012 01:40:43 +0000 (01:40 +0000)]
Use sse_load_f32/64 for scalar FMA3 intrinsic patterns instead of 128-bit loads to match instruction behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157895 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd neverHasSideEffects and mayLoad to FMA3 instructions.
Craig Topper [Sun, 3 Jun 2012 00:30:49 +0000 (00:30 +0000)]
Add neverHasSideEffects and mayLoad to FMA3 instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157894 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse access(2) instead of stat(2) to check if a file exists.
Benjamin Kramer [Sat, 2 Jun 2012 16:28:09 +0000 (16:28 +0000)]
Use access(2) instead of stat(2) to check if a file exists.

Apart from being slightly cheaper, this fixes a real bug that hits 32 bit
linux systems. When passing a file larger than 2G to be linked (which isn't
that uncommon with large projects such as WebKit), clang's driver checks
if the file exists but the file size doesn't fit in an off_t and stat(2)
fails with EOVERFLOW. Clang then says that the file doesn't exist instead
of passing it to the linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157891 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded unittests for IntegersSubset and IntegersSubsetMapping.
Stepan Dyatkovskiy [Sat, 2 Jun 2012 13:47:12 +0000 (13:47 +0000)]
Added unittests for IntegersSubset and IntegersSubsetMapping.
- Fixed IntegersSubsetGeneric copy/assignment behaviour.
- Fixed IntegersSubsetGeneric::getSize/getSingleValue methods.
- Fixed IntegersSubsetGeneric::verify method.

Also IntegersSubset.h and IntegersSubsetMapping.h headers was fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157887 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix typos found by http://github.com/lyda/misspell-check
Benjamin Kramer [Sat, 2 Jun 2012 10:20:22 +0000 (10:20 +0000)]
Fix typos found by github.com/lyda/misspell-check

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR1255: case ranges.
Stepan Dyatkovskiy [Sat, 2 Jun 2012 09:42:43 +0000 (09:42 +0000)]
PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157884 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd move semantics to APInt.
Benjamin Kramer [Sat, 2 Jun 2012 08:39:08 +0000 (08:39 +0000)]
Add move semantics to APInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157883 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdditional change for 157881. Forget to fix another IntegerSubset constructor.
Stepan Dyatkovskiy [Sat, 2 Jun 2012 08:03:34 +0000 (08:03 +0000)]
Additional change for 157881. Forget to fix another IntegerSubset constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157882 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSmall fix due to buildbot failures on mingw32. Fixed call of parent constructor for...
Stepan Dyatkovskiy [Sat, 2 Jun 2012 07:44:19 +0000 (07:44 +0000)]
Small fix due to buildbot failures on mingw32. Fixed call of parent constructor for case when parent is template.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157881 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR1255: case ranges.
Stepan Dyatkovskiy [Sat, 2 Jun 2012 07:26:00 +0000 (07:26 +0000)]
PR1255: case ranges.
IntegersSubsetGeneric, IntegersSubsetMapping: added IntTy template parameter, that allows use either APInt or IntItem. This change allows to write unittest for these classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157880 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM: add testing case for struct byval
Manman Ren [Sat, 2 Jun 2012 05:37:44 +0000 (05:37 +0000)]
ARM: add testing case for struct byval

rdar://9877866

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157876 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd another test case which tests Mips' unaligned load/store instructions.
Akira Hatanaka [Sat, 2 Jun 2012 01:13:10 +0000 (01:13 +0000)]
Add another test case which tests Mips' unaligned load/store instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157874 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a bug in the code which custom-lowers truncating stores in LegalizeDAG.
Akira Hatanaka [Sat, 2 Jun 2012 01:10:34 +0000 (01:10 +0000)]
Fix a bug in the code which custom-lowers truncating stores in LegalizeDAG.

Check that the SDValue TargetLowering::LowerOperation returns is not null
before replacing the original node with the returned node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157873 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoremove an unused variable.
Chris Lattner [Sat, 2 Jun 2012 01:03:42 +0000 (01:03 +0000)]
remove an unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157872 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix test cases in test/CodeGen/Mips.
Akira Hatanaka [Sat, 2 Jun 2012 00:05:45 +0000 (00:05 +0000)]
Fix test cases in test/CodeGen/Mips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157868 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove code which is no longer needed in MipsAsmPrinter and MipsMCInstLower.
Akira Hatanaka [Sat, 2 Jun 2012 00:05:11 +0000 (00:05 +0000)]
Remove code which is no longer needed in MipsAsmPrinter and MipsMCInstLower.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157867 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSet operation actions for load/store nodes in the Mips backend.
Akira Hatanaka [Sat, 2 Jun 2012 00:04:42 +0000 (00:04 +0000)]
Set operation actions for load/store nodes in the Mips backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157866 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd definitions of 32/64-bit unaligned load/store instructions for Mips.
Akira Hatanaka [Sat, 2 Jun 2012 00:04:19 +0000 (00:04 +0000)]
Add definitions of 32/64-bit unaligned load/store instructions for Mips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157865 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDefine functions MipsTargetLowering::LowerLOAD and LowerSTORE which
Akira Hatanaka [Sat, 2 Jun 2012 00:03:49 +0000 (00:03 +0000)]
Define functions MipsTargetLowering::LowerLOAD and LowerSTORE which
custom-lower unaligned load and store nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157864 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDefine Mips specific unaligned load/store nodes.
Akira Hatanaka [Sat, 2 Jun 2012 00:03:12 +0000 (00:03 +0000)]
Define Mips specific unaligned load/store nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157863 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExpand unaligned i16 loads/stores for the Mips backend.
Akira Hatanaka [Sat, 2 Jun 2012 00:02:45 +0000 (00:02 +0000)]
Expand unaligned i16 loads/stores for the Mips backend.

This is the first of a series of patches which make changes to the backend to
emit unaligned load/store instructions (lwl,lwr,swl,swr) during instruction
selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157862 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn MipsMCInstLower::LowerSymbolOperand, get offset from symbol if
Akira Hatanaka [Sat, 2 Jun 2012 00:02:11 +0000 (00:02 +0000)]
In MipsMCInstLower::LowerSymbolOperand, get offset from symbol if
the MachineOperand type has a valid offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157861 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the old register list functions from MCRegisterInfo.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 23:28:34 +0000 (23:28 +0000)]
Remove the old register list functions from MCRegisterInfo.

These functions exposed the layout of the underlying data tables as
null-terminated uint16_t arrays.

Use the new MCSubRegIterator, MCSuperRegIterator, and MCRegAliasIterator
classes instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157855 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch all register list clients to the new MC*Iterator interface.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 23:28:30 +0000 (23:28 +0000)]
Switch all register list clients to the new MC*Iterator interface.

No functional change intended.

Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.

This makes it possible to do so without changing all clients (again).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157854 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRegister the gcov "writeout" at init time. Don't list this as a d'tor. Instead,
Bill Wendling [Fri, 1 Jun 2012 23:14:32 +0000 (23:14 +0000)]
Register the gcov "writeout" at init time. Don't list this as a d'tor. Instead,
inject some code in that will run via the "__mod_init_func" method that
registers the gcov "writeout" function to execute at exit time.

The problem is that the "__mod_term_func" method of specifying d'tors is
deprecated on Darwin. And it can lead to some ambiguities when dealing with
multiple libraries.
<rdar://problem/11110106>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157852 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove physreg support from adjustCopiesBackFrom and removeCopyByCommutingDef.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 22:38:19 +0000 (22:38 +0000)]
Remove physreg support from adjustCopiesBackFrom and removeCopyByCommutingDef.

After physreg coalescing was disabled, these functions can't do anything
useful with physregs anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157849 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSimplify some more getAliasSet callers.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 22:38:17 +0000 (22:38 +0000)]
Simplify some more getAliasSet callers.

MCRegAliasIterator can include Reg itself in the list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157848 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse dominates(Instruction, Use) in the verifier.
Rafael Espindola [Fri, 1 Jun 2012 21:56:26 +0000 (21:56 +0000)]
Use dominates(Instruction, Use) in the verifier.
This removes a bit of context from the verifier erros, but reduces code
duplication in a fairly critical part of LLVM and makes dominates easier to test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157845 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[arm-fast-isel] Fix handling of the frameaddress intrinsic. If depth is 0
Chad Rosier [Fri, 1 Jun 2012 21:12:31 +0000 (21:12 +0000)]
[arm-fast-isel] Fix handling of the frameaddress intrinsic.  If depth is 0
then DestReg is undefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157840 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch some getAliasSet clients to MCRegAliasIterator.
Jakob Stoklund Olesen [Fri, 1 Jun 2012 20:36:54 +0000 (20:36 +0000)]
Switch some getAliasSet clients to MCRegAliasIterator.

MCRegAliasIterator can optionally visit the register itself, allowing
for simpler code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157837 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoX86: peephole optimization to remove cmp instruction
Manman Ren [Fri, 1 Jun 2012 19:49:33 +0000 (19:49 +0000)]
X86: peephole optimization to remove cmp instruction

This patch will optimize the following:
  sub r1, r3
  cmp r3, r1 or cmp r1, r3
  bge L1
TO
  sub r1, r3
  bge L1 or ble L1

If the branch instruction can use flag from "sub", then we can eliminate
the "cmp" instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157831 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM: properly handle alignment for struct byval.
Manman Ren [Fri, 1 Jun 2012 19:33:18 +0000 (19:33 +0000)]
ARM: properly handle alignment for struct byval.

Factor out the expansion code into a function.
This change is to be enabled in clang.

rdar://9877866

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157830 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd some tests checking that the verifier rejects cases where a definition
Rafael Espindola [Fri, 1 Jun 2012 19:24:57 +0000 (19:24 +0000)]
Add some tests checking that the verifier rejects cases where a definition
doesn't dominate a use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157829 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProvide move semantics for (Small)BitVector.
Benjamin Kramer [Fri, 1 Jun 2012 18:52:53 +0000 (18:52 +0000)]
Provide move semantics for (Small)BitVector.

CodeGen makes a lot of BitVector copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157826 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotestcase for PR13006, thanks to Duncan for filing it.
Chris Lattner [Fri, 1 Jun 2012 18:19:46 +0000 (18:19 +0000)]
testcase for PR13006, thanks to Duncan for filing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBoundsChecking: fix a bug when the handling of recursive PHIs failed and could leave...
Nuno Lopes [Fri, 1 Jun 2012 17:43:31 +0000 (17:43 +0000)]
BoundsChecking: fix a bug when the handling of recursive PHIs failed and could leave dangling references in the cache
add regression tests for this problem.

Can already compile & run: PHP, PCRE, and ICU  (i.e., all the software I tried)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157822 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement the local-dynamic TLS model for x86 (PR3985)
Hans Wennborg [Fri, 1 Jun 2012 16:27:21 +0000 (16:27 +0000)]
Implement the local-dynamic TLS model for x86 (PR3985)

This implements codegen support for accesses to thread-local variables
using the local-dynamic model, and adds a clean-up pass so that the base
address for the TLS block can be re-used between local-dynamic access on
an execution path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157818 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR1255: case ranges.
Stepan Dyatkovskiy [Fri, 1 Jun 2012 16:17:57 +0000 (16:17 +0000)]
PR1255: case ranges.
IntegersSubset devided into IntegersSubsetGeneric and into IntegersSubset itself. The first has no references to ConstantInt and works with IntItem only.
IntegersSubsetMapping also made generic. Here added second template parameter "IntegersSubsetTy" that allows to use on of two IntegersSubset types described below.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157815 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove noisy semicolons.
Benjamin Kramer [Fri, 1 Jun 2012 15:40:53 +0000 (15:40 +0000)]
Remove noisy semicolons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157814 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoquick fix for PR13006, will check in testcase later.
Chris Lattner [Fri, 1 Jun 2012 15:02:52 +0000 (15:02 +0000)]
quick fix for PR13006, will check in testcase later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157813 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR1255: case ranges.
Stepan Dyatkovskiy [Fri, 1 Jun 2012 10:06:14 +0000 (10:06 +0000)]
PR1255: case ranges.
IntItem cleanup. IntItemBase, IntItemConstantIntImp and IntItem merged into IntItem. All arithmetic operators was propogated from APInt. Also added comparison operators <,>,<=,>=. Currently you will find set of macros that propogates operators from APInt to IntItem in the beginning of IntegerSubset. Note that THESE MACROS WILL REMOVED after all passes will case-ranges compatible. Also note that these macros much smaller pain that something like this:
if (V->getValue().ugt(AnotherV->getValue()) { ... }

These changes made IntItem full featured integer object. It allows to make IntegerSubset class generic (move out all ConstantInt references inside and add unit-tests) in next commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157810 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable automatic detection of FMA3 support to allow intrinsics to be used.
Craig Topper [Fri, 1 Jun 2012 06:10:14 +0000 (06:10 +0000)]
Enable automatic detection of FMA3 support to allow intrinsics to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157805 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove fadd(fmul) patterns for FMA3. This needs to be implemented by paying attention...
Craig Topper [Fri, 1 Jun 2012 06:07:48 +0000 (06:07 +0000)]
Remove fadd(fmul) patterns for FMA3. This needs to be implemented by paying attention to FP_CONTRACT and matching @llvm.fma which is not available yet. This will allow us to enablle intrinsic use at least though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157804 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd VFNSUB* instructions to folding table.
Craig Topper [Fri, 1 Jun 2012 05:48:39 +0000 (05:48 +0000)]
Add VFNSUB* instructions to folding table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157802 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove a trailing space and fix a comment.
Craig Topper [Fri, 1 Jun 2012 05:34:01 +0000 (05:34 +0000)]
Remove a trailing space and fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157801 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoenhance the logic for looking through tailcalls to look through transparent casts
Chris Lattner [Fri, 1 Jun 2012 05:29:15 +0000 (05:29 +0000)]
enhance the logic for looking through tailcalls to look through transparent casts
in multiple-return value scenarios, like what happens on X86-64 when returning
small structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157800 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTidy up. Remove trailing spaces and fix the worst of the 80 column violations.
Craig Topper [Fri, 1 Jun 2012 05:24:29 +0000 (05:24 +0000)]
Tidy up. Remove trailing spaces and fix the worst of the 80 column violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157799 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoenhance getNoopInput to know about vector<->vector bitcasts of legal
Chris Lattner [Fri, 1 Jun 2012 05:16:33 +0000 (05:16 +0000)]
enhance getNoopInput to know about vector<->vector bitcasts of legal
types, as well as int<->ptr casts.  This allows us to tailcall functions
with some trivial casts between the call and return (i.e. because the
return types disagree).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157798 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd some simple 64-bit tail call tests.
Chris Lattner [Fri, 1 Jun 2012 05:03:31 +0000 (05:03 +0000)]
add some simple 64-bit tail call tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157797 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorearrange some logic, no functionality change.
Chris Lattner [Fri, 1 Jun 2012 05:01:15 +0000 (05:01 +0000)]
rearrange some logic, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157796 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomerge some tests.
Chris Lattner [Fri, 1 Jun 2012 05:00:54 +0000 (05:00 +0000)]
merge some tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157795 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorename test
Chris Lattner [Fri, 1 Jun 2012 04:58:50 +0000 (04:58 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM: support struct byval in llvm
Manman Ren [Fri, 1 Jun 2012 02:44:42 +0000 (02:44 +0000)]
ARM: support struct byval in llvm

We handle struct byval by inserting a pseudo op, which will be expanded to a
loop at ExpandISelPseudos.
A separate patch for clang will be submitted to enable struct byval.

rdar://9877866

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157793 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix 80 columns.
Michael J. Spencer [Fri, 1 Jun 2012 00:58:41 +0000 (00:58 +0000)]
Fix 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157788 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for enum forward declarations.
Eric Christopher [Fri, 1 Jun 2012 00:22:32 +0000 (00:22 +0000)]
Add support for enum forward declarations.

Part of rdar://11570854

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157786 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPut the shiny new MCSubRegIterator to work.
Chad Rosier [Fri, 1 Jun 2012 00:02:08 +0000 (00:02 +0000)]
Put the shiny new MCSubRegIterator to work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157783 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd -bounds-checking-multiple-traps option to make one trap BB per check
Nuno Lopes [Thu, 31 May 2012 22:58:48 +0000 (22:58 +0000)]
add -bounds-checking-multiple-traps option to make one trap BB per check
disabled by default for now; we can discusse the default value (& name) later

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157777 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorevamp BoundsChecking considerably:
Nuno Lopes [Thu, 31 May 2012 22:45:40 +0000 (22:45 +0000)]
revamp BoundsChecking considerably:
 - compute size & offset at the same time. The side-effects of this are that we now support negative GEPs. It's now approaching a phase that it can be reused by other passes (e.g., lowering of the objectsize intrinsic)
 - use APInt throughout to handle wrap-arounds
 - add support for PHI instrumentation
 - add a cache (required for recursive PHIs anyway)
 - remove hoisting support for now, since it was wrong in a few cases

sorry for the churn here.. tests will follow soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157775 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntrusiveRefCntPtr: Simplify operator= as suggested by Richard Smith.
Benjamin Kramer [Thu, 31 May 2012 22:25:25 +0000 (22:25 +0000)]
IntrusiveRefCntPtr: Simplify operator= as suggested by Richard Smith.

This way the constructors do all the hard work. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157773 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake this testcase independent of register allocation.
Owen Anderson [Thu, 31 May 2012 18:07:02 +0000 (18:07 +0000)]
Make this testcase independent of register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157761 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for return value promotion in X86 calling conventions.
Jakob Stoklund Olesen [Thu, 31 May 2012 17:28:20 +0000 (17:28 +0000)]
Add support for return value promotion in X86 calling conventions.

Patch by Yiannis Tsiouris!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157757 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDidn't mean to export this function.
Jakob Stoklund Olesen [Thu, 31 May 2012 17:21:27 +0000 (17:21 +0000)]
Didn't mean to export this function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157756 91177308-0d34-0410-b5e6-96231b3b80d8