oota-llvm.git
12 years agoARM SSAT instruction 5-bit immediate handling.
Jim Grosbach [Fri, 22 Jul 2011 23:16:18 +0000 (23:16 +0000)]
ARM SSAT instruction 5-bit immediate handling.

The immediate is in the range 1-32, but is encoded as 0-31 in a 5-bit bitfield.
Update the representation such that we store the operand as 0-31, allowing us
to remove the encoder method and the special case handling in the disassembler.
Update the assembly parser and the instruction printer accordingly.

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

12 years agoMove the last uses of RetainFunc etc. over to using getRetainCallee() etc.
Dan Gohman [Fri, 22 Jul 2011 22:29:21 +0000 (22:29 +0000)]
Move the last uses of RetainFunc etc. over to using getRetainCallee() etc.
so that a declaration for objc_retain is created when needed if it doesn't
already exist. rdar://9825114.

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

12 years agoTeach cmake configured headers about LLVM_NATIVE_TARGETMC
Oscar Fuentes [Fri, 22 Jul 2011 22:21:47 +0000 (22:21 +0000)]
Teach cmake configured headers about LLVM_NATIVE_TARGETMC

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

12 years agoAdd FIXME
Jim Grosbach [Fri, 22 Jul 2011 22:15:38 +0000 (22:15 +0000)]
Add FIXME

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

12 years agoARM encoding and assembly parsing tests for SMULWB, SMULWT, SMUSD and SMUSDX.
Jim Grosbach [Fri, 22 Jul 2011 22:13:00 +0000 (22:13 +0000)]
ARM encoding and assembly parsing tests for SMULWB, SMULWT, SMUSD and SMUSDX.

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

12 years agoARM assembly parsing and encoding updates.
Jim Grosbach [Fri, 22 Jul 2011 22:06:05 +0000 (22:06 +0000)]
ARM assembly parsing and encoding updates.

Tests for SMULBB, SMLALBT, SMLALTB, SMLALTT, and SMULL. Fix parsing of SMULLS.

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

12 years agoUse the enum value for RegClassIDs.
Benjamin Kramer [Fri, 22 Jul 2011 22:01:58 +0000 (22:01 +0000)]
Use the enum value for RegClassIDs.

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

12 years agoCombine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
Evan Cheng [Fri, 22 Jul 2011 21:58:54 +0000 (21:58 +0000)]
Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC.

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

12 years agoadd section to ToC
Chris Lattner [Fri, 22 Jul 2011 21:36:29 +0000 (21:36 +0000)]
add section to ToC

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

12 years agoARM assembly parsing and encoding tests.
Jim Grosbach [Fri, 22 Jul 2011 21:34:56 +0000 (21:34 +0000)]
ARM assembly parsing and encoding tests.

Add tests for SMLSD, SMLSDX, SMLSLD, SMLSLDX, SMMLA, SMMLAR, SMMLS, SMMLSR,
SMMUL, SMMULR, SMUAD and SMUADX.

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

12 years agowrite the long-overdue strings section of the data structure guide.
Chris Lattner [Fri, 22 Jul 2011 21:34:12 +0000 (21:34 +0000)]
write the long-overdue strings section of the data structure guide.

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

12 years agoEmit the __compact_unwind section first. If there are any frames which weren't
Bill Wendling [Fri, 22 Jul 2011 21:18:59 +0000 (21:18 +0000)]
Emit the __compact_unwind section first. If there are any frames which weren't
emitted, emit them next as CIE/FDEs.

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

12 years agoAdd a method to set the compact unwind info.
Bill Wendling [Fri, 22 Jul 2011 21:17:05 +0000 (21:17 +0000)]
Add a method to set the compact unwind info.

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

12 years agoAdd a method to get the list of FrameInfos.
Bill Wendling [Fri, 22 Jul 2011 21:16:32 +0000 (21:16 +0000)]
Add a method to get the list of FrameInfos.

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

12 years agoFix test check!
Bruno Cardoso Lopes [Fri, 22 Jul 2011 20:55:28 +0000 (20:55 +0000)]
Fix test check!

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

12 years agoFix PR10422 by adding the necessary AVX UCOMISD memory versions to
Bruno Cardoso Lopes [Fri, 22 Jul 2011 20:53:20 +0000 (20:53 +0000)]
Fix PR10422 by adding the necessary AVX UCOMISD memory versions to
load folding logic

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

12 years agoARM assembly parsing and encoding tests for SMLAWB/SMLAWT.
Jim Grosbach [Fri, 22 Jul 2011 20:51:24 +0000 (20:51 +0000)]
ARM assembly parsing and encoding tests for SMLAWB/SMLAWT.

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

12 years agomove the section for string-like containers to follow the section for sequential...
Chris Lattner [Fri, 22 Jul 2011 20:46:49 +0000 (20:46 +0000)]
move the section for string-like containers to follow the section for sequential containers.

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

12 years agoARM assembly parsing and encoding tests.
Jim Grosbach [Fri, 22 Jul 2011 20:30:40 +0000 (20:30 +0000)]
ARM assembly parsing and encoding tests.

Tests for SMLAL, SMLALBB, SMLALBT, SMLALTB, SMLALTT, SMLALD, and SMLALDX
instructions.

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

12 years agoARM assembly parsing and encoding of SMLAL instruction.
Jim Grosbach [Fri, 22 Jul 2011 20:18:21 +0000 (20:18 +0000)]
ARM assembly parsing and encoding of SMLAL instruction.

Fix parsing of carry-setting variant SMLALS and add tests.

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

12 years agoARM encoding and assembly parsing of SMLAD{X} instructions.
Jim Grosbach [Fri, 22 Jul 2011 20:11:20 +0000 (20:11 +0000)]
ARM encoding and assembly parsing of SMLAD{X} instructions.

Fix encoding of destination register. Add tests.

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

12 years agoARM testcases for assembly parsing and encoding SMLA* instructions.
Jim Grosbach [Fri, 22 Jul 2011 20:01:34 +0000 (20:01 +0000)]
ARM testcases for assembly parsing and encoding SMLA* instructions.

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

12 years agoAdd v8f32->v8i32 bitcast. Fixes PR10440
Bruno Cardoso Lopes [Fri, 22 Jul 2011 19:51:02 +0000 (19:51 +0000)]
Add v8f32->v8i32 bitcast. Fixes PR10440

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

12 years agoTurn shuffles into unpacks for VT == MVT::v2i64 and MVT::v2f64
Rafael Espindola [Fri, 22 Jul 2011 18:56:05 +0000 (18:56 +0000)]
Turn shuffles into unpacks for VT == MVT::v2i64 and MVT::v2f64
too. Patch by Jeff Muizelaar.

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

12 years agoFix x86's XALUO lowering to return its replacement values instead
Dan Gohman [Fri, 22 Jul 2011 18:45:15 +0000 (18:45 +0000)]
Fix x86's XALUO lowering to return its replacement values instead
of doing the RAUW calls for the overflow value itself. This makes
it more consistent with how the rest of LegalizeDAG works.

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

12 years agollvm-objdump: Don't ignore errors from raw_fd_ostream.
Benjamin Kramer [Fri, 22 Jul 2011 18:35:11 +0000 (18:35 +0000)]
llvm-objdump: Don't ignore errors from raw_fd_ostream.

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

12 years agollvm-objdump: Skip branches that leave the current function.
Benjamin Kramer [Fri, 22 Jul 2011 18:35:09 +0000 (18:35 +0000)]
llvm-objdump: Skip branches that leave the current function.

In "normal" code these only happen when disassembling data, so we
won't lose anything if we just drop them.

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

12 years agoFix test failures caused by my so_reg refactoring.
Owen Anderson [Fri, 22 Jul 2011 18:30:30 +0000 (18:30 +0000)]
Fix test failures caused by my so_reg refactoring.

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

12 years agoARM assembly parsing and encoding for SMC instruction.
Jim Grosbach [Fri, 22 Jul 2011 18:13:31 +0000 (18:13 +0000)]
ARM assembly parsing and encoding for SMC instruction.

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

12 years agoClean up a few more comments.
Jim Grosbach [Fri, 22 Jul 2011 18:06:01 +0000 (18:06 +0000)]
Clean up a few more comments.

These instruction definitions are for the assembler, too, not just the
disassembler.

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

12 years agoARM encoding and assembly parsing tests.
Jim Grosbach [Fri, 22 Jul 2011 18:04:48 +0000 (18:04 +0000)]
ARM encoding and assembly parsing tests.

Add tests for SHADD8, SHADD16, SHASX, SHSUB8, and SHSUB16.

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

12 years agoTidy up.
Jim Grosbach [Fri, 22 Jul 2011 18:04:10 +0000 (18:04 +0000)]
Tidy up.

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

12 years agoThumb assembly support for SETEND instruction.
Jim Grosbach [Fri, 22 Jul 2011 17:52:23 +0000 (17:52 +0000)]
Thumb assembly support for SETEND instruction.

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

12 years agoTidy up.
Jim Grosbach [Fri, 22 Jul 2011 17:46:13 +0000 (17:46 +0000)]
Tidy up.

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

12 years agoARM assembly parsing and encoding for SETEND instruction.
Jim Grosbach [Fri, 22 Jul 2011 17:44:50 +0000 (17:44 +0000)]
ARM assembly parsing and encoding for SETEND instruction.

Add parsing and diagnostics for malformed inputs. Tests for diagnostics and
for correct encodings.

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

12 years agoARM assembly parsing and encoding tests for SEL instruction.
Jim Grosbach [Fri, 22 Jul 2011 16:59:33 +0000 (16:59 +0000)]
ARM assembly parsing and encoding tests for SEL instruction.

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

12 years agoTidy up.
Jim Grosbach [Fri, 22 Jul 2011 16:59:04 +0000 (16:59 +0000)]
Tidy up.

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

12 years agoRemove unused variables.
Benjamin Kramer [Fri, 22 Jul 2011 16:06:09 +0000 (16:06 +0000)]
Remove unused variables.

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

12 years agoFix more MSVC warnings caused by a cases I missed when converting
Jay Foad [Fri, 22 Jul 2011 08:52:50 +0000 (08:52 +0000)]
Fix more MSVC warnings caused by a cases I missed when converting
ConstantExpr::getGetElementPtr to use ArrayRef.

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

12 years agoConvert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
Jay Foad [Fri, 22 Jul 2011 08:16:57 +0000 (08:16 +0000)]
Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.

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

12 years agoMove TargetRegistry.cpp from lib/Support to lib/Target where it belongs.
Chandler Carruth [Fri, 22 Jul 2011 08:16:53 +0000 (08:16 +0000)]
Move TargetRegistry.cpp from lib/Support to lib/Target where it belongs.
The header file was already properly located. The previous need for it
in Support had to do with the version string printing which was fixed in
r135757.

Also update build dependencies where libraries that needed the
functionality of the Target library (in the form of the TargetRegistry)
were picking it up via Support. This is pretty pervasive, essentially
every TargetInfo library (ARMInfo, etc) uses TargetRegistry, making it
depend on Target. All of these were previously just sneaking by.

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

12 years agoUpdate the CMake library dependencies. These shifts are the result of
Chandler Carruth [Fri, 22 Jul 2011 08:05:47 +0000 (08:05 +0000)]
Update the CMake library dependencies. These shifts are the result of
Evan's recent refactorings (I believe). Specifically, MCDisassembler no
longer depends on Target, and ARMDisassembler no longer depends on
CodeGen. The added dependencies from ARMAsmParser to ARMDesc looks
correct based on header file inclusion.

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

12 years agoFix an MSVC warning, caused by a case I missed when converting
Jay Foad [Fri, 22 Jul 2011 07:54:01 +0000 (07:54 +0000)]
Fix an MSVC warning, caused by a case I missed when converting
ConstantExpr::getGetElementPtr to use ArrayRef.

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

12 years agoMove the registered target printing in version strings completely out of
Chandler Carruth [Fri, 22 Jul 2011 07:50:48 +0000 (07:50 +0000)]
Move the registered target printing in version strings completely out of
the Support library. Now its part of the TargetRegistry, and the three
commands that care about this explicitly register this extra bit of
version information.

The set of commands which care was computed by intersecting those which
use the Support library's version string printing and those that
initialize all the registered targets in a way that produces
a meaningful list. The only odd ball out is that 'clang -cc1as -version'
no longer prints the registered targets. I don't think anyone is really
interested in that (especially as the fact that llvm-mc does so is under
a FIXME), but if someone really does want this back I'll happily apply
the same patch there.

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

12 years agoMove the logic for printing the registered targets into a static
Chandler Carruth [Fri, 22 Jul 2011 07:50:44 +0000 (07:50 +0000)]
Move the logic for printing the registered targets into a static
function on the TargetRegistry. Also clean it up and use the modern LLVM
utility libraries available instead of rolling a few things manually.

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

12 years agoAdd an extension point to the CommandLine library where clients can
Chandler Carruth [Fri, 22 Jul 2011 07:50:40 +0000 (07:50 +0000)]
Add an extension point to the CommandLine library where clients can
register extra version information to be printed. This is designed to
allow those tools which link in various targets to also print those
registered targets under --version.

Currently this printing logic is embedded into the Support library
directly; a huge layering violation. This is the first step to hoisting
it out into the tools without adding lots of duplicated code.

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

12 years agolib/Support/Triple.cpp: Recognize "-march=ppc32" to llc properly, as quick hack.
NAKAMURA Takumi [Fri, 22 Jul 2011 04:02:22 +0000 (04:02 +0000)]
lib/Support/Triple.cpp: Recognize "-march=ppc32" to llc properly, as quick hack.

FIXME: There is an inconsistency. llvm::Triple does not understand "ppc32" and PowerPC/TargetInfo holds "ppc32".

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

12 years agoSome LangRef tweaks, per Dan's comments.
Eli Friedman [Fri, 22 Jul 2011 03:04:45 +0000 (03:04 +0000)]
Some LangRef tweaks, per Dan's comments.

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

12 years agoAllow getBlockFreq to return 0.
Jakub Staszak [Fri, 22 Jul 2011 02:24:57 +0000 (02:24 +0000)]
Allow getBlockFreq to return 0.

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

12 years agoGCC complains about the angle of this line.
Benjamin Kramer [Fri, 22 Jul 2011 01:02:57 +0000 (01:02 +0000)]
GCC complains about the angle of this line.

Remove the escaped newline.

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

12 years agoRevert patch which broke some IfConversion tests.
Jakub Staszak [Fri, 22 Jul 2011 00:55:15 +0000 (00:55 +0000)]
Revert patch which broke some IfConversion tests.

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

12 years agoTeach tblgen to emit MCRegisterClasses.
Benjamin Kramer [Fri, 22 Jul 2011 00:44:39 +0000 (00:44 +0000)]
Teach tblgen to emit MCRegisterClasses.

- This currently introduces more instances of the static DenseSet dtor, but that should be fixable.

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

12 years agoFix typo in #include which revealed in the case-sensitive filesystem.
Jakub Staszak [Fri, 22 Jul 2011 00:39:00 +0000 (00:39 +0000)]
Fix typo in #include which revealed in the case-sensitive filesystem.

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

12 years agoRemove the 128-bit special handling from SCALAR_TO_VECTOR. This isn't
Bruno Cardoso Lopes [Fri, 22 Jul 2011 00:15:10 +0000 (00:15 +0000)]
Remove the 128-bit special handling from SCALAR_TO_VECTOR. This isn't
the way to go. Doing this here will prevent several node matches later,
and would have to force looking all the way through several
VINSERTF128/VEXTRACTF128 chains to optimize simple things.

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

12 years ago-Inspected a AVX code block added by someone in early Feb. This was never used
Bruno Cardoso Lopes [Fri, 22 Jul 2011 00:15:07 +0000 (00:15 +0000)]
-Inspected a AVX code block added by someone in early Feb. This was never used
and was actually very wrong, fix it and make it simpler. Also remove the
ConcatVectors function, which is unused now.

- Fix a introduction of useless nodes in r126664 and r126264. The
VUNPCKL* should never be introduced cause we don't want duplicate
nodes for 128 AVX and non-AVX modes, the actual instruction
difference only exists during isel, but not for target specific DAG
nodes. We only introduce V* target nodes when there is no 128-bit
version already there.

- Fix a fragile test and make it more useful.

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

12 years agoAlthough we already support this, add testcases for consistency
Bruno Cardoso Lopes [Fri, 22 Jul 2011 00:15:03 +0000 (00:15 +0000)]
Although we already support this, add testcases for consistency

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

12 years agoAdd a DAGCombine for transforming 128->256 casts into a simple
Bruno Cardoso Lopes [Fri, 22 Jul 2011 00:15:00 +0000 (00:15 +0000)]
Add a DAGCombine for transforming 128->256 casts into a simple
vxorps + vinsertf128 pair of instructions

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

12 years agoIntroduce a new function to lower 256-bit vectors which are not
Bruno Cardoso Lopes [Fri, 22 Jul 2011 00:14:56 +0000 (00:14 +0000)]
Introduce a new function to lower 256-bit vectors which are not
direclty supported and should be promoted and handled by smaller
shuffles

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

12 years agoRename function to be more specific and be more strict about its usage
Bruno Cardoso Lopes [Fri, 22 Jul 2011 00:14:53 +0000 (00:14 +0000)]
Rename function to be more specific and be more strict about its usage

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

12 years agoUse MachineBranchProbabilityInfo instead of MachineLoopInfo in IfConversion.
Jakub Staszak [Thu, 21 Jul 2011 23:48:55 +0000 (23:48 +0000)]
Use MachineBranchProbabilityInfo instead of MachineLoopInfo in IfConversion.

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

12 years agoGet rid of the extraneous GPR operand on so_reg_imm operands, which in turn necessita...
Owen Anderson [Thu, 21 Jul 2011 23:38:37 +0000 (23:38 +0000)]
Get rid of the extraneous GPR operand on so_reg_imm operands, which in turn necessitates a lot of changes to related bits.

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

12 years agoFix MergeInVectorType to check for vector types with the same alloc
Dan Gohman [Thu, 21 Jul 2011 23:30:09 +0000 (23:30 +0000)]
Fix MergeInVectorType to check for vector types with the same alloc
size but different element types, so that it filters out the cases
that CreateShuffleVectorCast doesn't handle. This fixes rdar://9786827.

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

12 years agoARM Asm parser range checking for [0,31] immediates.
Jim Grosbach [Thu, 21 Jul 2011 23:26:25 +0000 (23:26 +0000)]
ARM Asm parser range checking for [0,31] immediates.

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

12 years agoARM parsing and encoding tests for SBC instruction.
Jim Grosbach [Thu, 21 Jul 2011 23:03:59 +0000 (23:03 +0000)]
ARM parsing and encoding tests for SBC instruction.

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

12 years agoInitialize DenseSets lazily.
Benjamin Kramer [Thu, 21 Jul 2011 23:03:59 +0000 (23:03 +0000)]
Initialize DenseSets lazily.

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

12 years agoARM testcases for SADD/SASX parsing and encoding.
Jim Grosbach [Thu, 21 Jul 2011 23:00:49 +0000 (23:00 +0000)]
ARM testcases for SADD/SASX parsing and encoding.

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

12 years agoAdd missing getAnalysisUsage in MachineBlockFrequency.
Jakub Staszak [Thu, 21 Jul 2011 22:59:09 +0000 (22:59 +0000)]
Add missing getAnalysisUsage in MachineBlockFrequency.

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

12 years agoARM assembly parsing support for RSC instruction.
Jim Grosbach [Thu, 21 Jul 2011 22:56:30 +0000 (22:56 +0000)]
ARM assembly parsing support for RSC instruction.

Add two-operand instruction aliases. Add parsing and encoding tests for
variants of the instruction.

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

12 years agoARM assembly parsing support for RSB instruction.
Jim Grosbach [Thu, 21 Jul 2011 22:37:43 +0000 (22:37 +0000)]
ARM assembly parsing support for RSB instruction.

Add two-operand instruction aliases. Add parsing and encoding tests for
variants of the instruction.

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

12 years agoARM parsing and encoding tests for RBIT, REV, REV16 and REVSH.
Jim Grosbach [Thu, 21 Jul 2011 22:29:23 +0000 (22:29 +0000)]
ARM parsing and encoding tests for RBIT, REV, REV16 and REVSH.

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

12 years agoARM parsing and encodings tests for saturating arithmetic insns.
Jim Grosbach [Thu, 21 Jul 2011 22:18:28 +0000 (22:18 +0000)]
ARM parsing and encodings tests for saturating arithmetic insns.

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

12 years agoTidy up.
Jim Grosbach [Thu, 21 Jul 2011 21:26:05 +0000 (21:26 +0000)]
Tidy up.

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

12 years agoUpdate generated CPP code with the new API on CallInst::Create and ConstantExpr:...
Nicolas Geoffray [Thu, 21 Jul 2011 20:59:21 +0000 (20:59 +0000)]
Update generated CPP code with the new API on CallInst::Create and ConstantExpr::getGetElementPtr.

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

12 years agoARM assembly parsing POP/PUSH mnemonics.
Jim Grosbach [Thu, 21 Jul 2011 19:57:11 +0000 (19:57 +0000)]
ARM assembly parsing POP/PUSH mnemonics.

Aliases for LDM/STM. The single-register versions should encode to LDR/STR
with writeback, but we don't (yet) get that correct. Neither does Darwin's
system assembler, though, so that's not a deal-breaker of a limitation.

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

12 years agoFix CMake build
Oscar Fuentes [Thu, 21 Jul 2011 19:10:57 +0000 (19:10 +0000)]
Fix CMake build

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

12 years agoAdd tests for ARM PKH assembly parsing.
Jim Grosbach [Thu, 21 Jul 2011 19:02:03 +0000 (19:02 +0000)]
Add tests for ARM PKH assembly parsing.

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

12 years agoSplit up the ARM so_reg ComplexPattern into so_reg_reg and so_reg_imm, allowing us...
Owen Anderson [Thu, 21 Jul 2011 18:54:16 +0000 (18:54 +0000)]
Split up the ARM so_reg ComplexPattern into so_reg_reg and so_reg_imm, allowing us to distinguish the encodings that use shifted registers from those that use shifted immediates.  This is necessary to allow the fixed-length decoder to distinguish things like BICS vs LDRH.

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

12 years agoCleanup: make std::pair usage slightly less indecipherable without actually naming...
Andrew Trick [Thu, 21 Jul 2011 17:37:39 +0000 (17:37 +0000)]
Cleanup: make std::pair usage slightly less indecipherable without actually naming variables!

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

12 years agoSink parts of TargetRegisterClass into MCRegisterClass.
Benjamin Kramer [Thu, 21 Jul 2011 17:26:50 +0000 (17:26 +0000)]
Sink parts of TargetRegisterClass into MCRegisterClass.

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

12 years agoARM assembly parsing and encoding for PKHBT and PKHTB instructions.
Jim Grosbach [Thu, 21 Jul 2011 17:23:04 +0000 (17:23 +0000)]
ARM assembly parsing and encoding for PKHBT and PKHTB instructions.

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

12 years agoAdded the infrastructute necessary for MIPS JIT support. Patch by Vladimir
Bruno Cardoso Lopes [Thu, 21 Jul 2011 16:28:51 +0000 (16:28 +0000)]
Added the infrastructute necessary for MIPS JIT support. Patch by Vladimir
Stefanovic. I removed the part that actually emits the instructions cause
I want that to get in better shape first and in incremental steps. This
also makes it easier to review the upcoming parts.

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

12 years agoMake better use of ConstantExpr::getGetElementPtr's InBounds parameter.
Jay Foad [Thu, 21 Jul 2011 15:15:37 +0000 (15:15 +0000)]
Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.

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

12 years agoSort case-insensitively.
Jay Foad [Thu, 21 Jul 2011 14:42:51 +0000 (14:42 +0000)]
Sort case-insensitively.

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

12 years agoConvert ConstantExpr::getGetElementPtr and
Jay Foad [Thu, 21 Jul 2011 14:31:17 +0000 (14:31 +0000)]
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

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

12 years agoUpdate llvm-gcc-4.2 and dragonegg after converting ConstantFolder APIs
Jay Foad [Thu, 21 Jul 2011 09:19:11 +0000 (09:19 +0000)]
Update llvm-gcc-4.2 and dragonegg after converting ConstantFolder APIs
to use ArrayRef.

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

12 years agoConvert ConstantFolder APIs to use ArrayRef.
Jay Foad [Thu, 21 Jul 2011 07:52:17 +0000 (07:52 +0000)]
Convert ConstantFolder APIs to use ArrayRef.

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

12 years agomove tier out of an anonymous namespace, it doesn't make sense
Chris Lattner [Thu, 21 Jul 2011 06:21:31 +0000 (06:21 +0000)]
move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.

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

12 years ago- Register v16i16 as valid VR256 register class
Bruno Cardoso Lopes [Thu, 21 Jul 2011 02:24:08 +0000 (02:24 +0000)]
- Register v16i16 as valid VR256 register class
- Add more bitcasts for v16i16
- Since 135661 and 135662 already added the splat logic,
just add one more splat test for v16i16

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

12 years agoAdd support for 256-bit versions of VPERMIL instruction. This is a new
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:47 +0000 (01:55 +0000)]
Add support for 256-bit versions of VPERMIL instruction. This is a new
instruction introduced in AVX, which can operate on 128 and 256-bit vectors.
It considers a 256-bit vector as two independent 128-bit lanes. It can permute
any 32 or 64 elements inside a lane, and restricts the second lane to
have the same permutation of the first one. With the improved splat support
introduced early today, adding codegen for this instruction enable more
efficient 256-bit code:

Instead of:
  vextractf128  $0, %ymm0, %xmm0
  punpcklbw %xmm0, %xmm0
  punpckhbw %xmm0, %xmm0
  vinsertf128 $0, %xmm0, %ymm0, %ymm1
  vinsertf128 $1, %xmm0, %ymm1, %ymm0
  vextractf128  $1, %ymm0, %xmm1
  shufps  $1, %xmm1, %xmm1
  movss %xmm1, 28(%rsp)
  movss %xmm1, 24(%rsp)
  movss %xmm1, 20(%rsp)
  movss %xmm1, 16(%rsp)
  vextractf128  $0, %ymm0, %xmm0
  shufps  $1, %xmm0, %xmm0
  movss %xmm0, 12(%rsp)
  movss %xmm0, 8(%rsp)
  movss %xmm0, 4(%rsp)
  movss %xmm0, (%rsp)
  vmovaps (%rsp), %ymm0
We get:
  vextractf128  $0, %ymm0, %xmm0
  punpcklbw %xmm0, %xmm0
  punpckhbw %xmm0, %xmm0
  vinsertf128 $0, %xmm0, %ymm0, %ymm1
  vinsertf128 $1, %xmm0, %ymm1, %ymm0
  vpermilps $85, %ymm0, %ymm0

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

12 years agoImprove splat promotion to handle AVX types: v32i8 and v16i16. Also
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:42 +0000 (01:55 +0000)]
Improve splat promotion to handle AVX types: v32i8 and v16i16. Also
refactor the code and add a bunch of comments. The final shuffle
emitted by handling 256-bit types is suitable for the VPERM shuffle
instruction which is going to be introduced in a next commit (with
a testcase which cover this commit)

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

12 years agoAdd aditional patterns for vextractf128 instruction
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:39 +0000 (01:55 +0000)]
Add aditional patterns for vextractf128 instruction

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

12 years agoAdd aditional patterns for vinsertf128 instruction
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:36 +0000 (01:55 +0000)]
Add aditional patterns for vinsertf128 instruction

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

12 years agoAdd v16i16 type to VR256 class
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:33 +0000 (01:55 +0000)]
Add v16i16 type to VR256 class

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

12 years agoMove code around. No functionality changes
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:30 +0000 (01:55 +0000)]
Move code around. No functionality changes

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

12 years agoTidy up code
Bruno Cardoso Lopes [Thu, 21 Jul 2011 01:55:27 +0000 (01:55 +0000)]
Tidy up code

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

12 years agoLSR, correct fix for rdar://9786536. Silly casting bug.
Andrew Trick [Thu, 21 Jul 2011 01:45:54 +0000 (01:45 +0000)]
LSR, correct fix for rdar://9786536. Silly casting bug.

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

12 years agoLSR must sometimes sign-extend before generating double constants.
Andrew Trick [Thu, 21 Jul 2011 01:05:01 +0000 (01:05 +0000)]
LSR must sometimes sign-extend before generating double constants.

rdar://9786536

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

12 years agoMark instructions which are part of the frame setup with the MachineInstr::FrameSetup...
Bill Wendling [Thu, 21 Jul 2011 00:44:56 +0000 (00:44 +0000)]
Mark instructions which are part of the frame setup with the MachineInstr::FrameSetup flag.

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

12 years agoLSR crashes on an empty IVUsers list.
Andrew Trick [Thu, 21 Jul 2011 00:40:04 +0000 (00:40 +0000)]
LSR crashes on an empty IVUsers list.

rdar://9786536

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

12 years agoX86 is the only target that uses coff format. This should fixes test failures running...
Evan Cheng [Wed, 20 Jul 2011 23:53:54 +0000 (23:53 +0000)]
X86 is the only target that uses coff format. This should fixes test failures running on Windows, Cygwin, or MingW hosts.

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