llvm-6502/lib
Bill Schmidt fc22bfd921 [PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics
This patch enables the vec_vsx_ld and vec_vsx_st intrinsics for
PowerPC, which provide programmer access to the lxvd2x, lxvw4x,
stxvd2x, and stxvw4x instructions.

New LLVM intrinsics are provided to represent these four instructions
in IntrinsicsPowerPC.td.  These are patterned after the similar
intrinsics for lvx and stvx (Altivec).  In PPCInstrVSX.td, these
intrinsics are tied to the code gen patterns, with additional patterns
to allow plain vanilla loads and stores to still generate these
instructions.

At -O1 and higher the intrinsics are immediately converted to loads
and stores in InstCombineCalls.cpp.  This will open up more
optimization opportunities while still allowing the correct
instructions to be generated.  (Similar code exists for aligned
Altivec loads and stores.)

The new intrinsics are added to the code that checks for consecutive
loads and stores in PPCISelLowering.cpp, as well as to
PPCTargetLowering::getTgtMemIntrinsic().

There's a new test to verify the correct instructions are generated.
The loads and stores tend to be reordered, so the test just counts
their number.  It runs at -O2, as it's not very effective to test this
at -O0, when many unnecessary loads and stores are generated.

I ended up having to modify vsx-fma-m.ll.  It turns out this test case
is slightly unreliable, but I don't know a good way to prevent
problems with it.  The xvmaddmdp instructions read and write the same
register, which is one of the multiplicands.  Commutativity allows
either to be chosen.  If the FMAs are reordered differently than
expected by the test, the register assignment can be different as a
result.  Hopefully this doesn't change often.

There is a companion patch for Clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221767 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-12 04:19:40 +00:00
..
Analysis Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
AsmParser
Bitcode Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
CodeGen Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
DebugInfo
ExecutionEngine Remove the now unused StringRefMemoryObject.h. 2014-11-12 02:13:27 +00:00
IR Extend intrinsic name mangling to support arrays, named structs, and function types. 2014-11-12 00:21:51 +00:00
IRReader
LineEditor
Linker Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
LTO libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts 2014-11-11 23:13:10 +00:00
MC Remove the now unused StringRefMemoryObject.h. 2014-11-12 02:13:27 +00:00
Object Object, support both mach-o archive t.o.c file names 2014-11-12 01:37:45 +00:00
Option
ProfileData
Support Merge StreamableMemoryObject into MemoryObject. 2014-11-12 03:55:46 +00:00
TableGen
Target [PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics 2014-11-12 04:19:40 +00:00
Transforms [PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics 2014-11-12 04:19:40 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile