Please start a thread on llvmdev about this functionality, and outline what other intrinsics will have to change to add non-8-bit byte support.
Well, memset is the only we have seen so far (our back-end is ~50% finished for an initial release). We have our own front-end as well (we are currently not using the clang front-end), and currently don't use many llvm intrinsics (only llvm.stacksave/llvm.stackrestore). The memset intrinsic is generated by opt.
This isn't the sort of feature that we just add without understanding the full impact.
The large impact we have seen is in other parts, regarding the assumtion that a byte is 8 bits. You can see a diffstat of our current patch below. However, this patch for non 8-bit bytes is a more clean approach to core changes:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120702/146050.html
It is on my todo-list to merge that patch with our changes. Do you want that kind of changes to be pushed first?
Regards,
Patrik Hägglund
include/llvm/CodeGen/SelectionDAG.h | 2 +-
include/llvm/CodeGen/ValueTypes.h | 43 ++++++++++++++++++++++++++++++++-----------
include/llvm/DataLayout.h | 22 ++++++++++++++++------
include/llvm/IRBuilder.h | 16 ++++++++++++++++
lib/Analysis/ConstantFolding.cpp | 74 ++++++++++++++++++++++++++++++++++++++++----------------------------------
lib/Analysis/ValueTracking.cpp | 22 +++++++++++++---------
lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 50 ++++++++++++++++++++++++++++++++++++++------------
lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | 6 ++++--
lib/CodeGen/AsmPrinter/DIE.cpp | 20 ++++++++++++--------
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 ++++---
lib/CodeGen/MachineFunction.cpp | 2 +-
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 58 +++++++++++++++++++++++++++++++++-------------------------
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 63 ++++++++++++++++++++++++++++++++++-----------------------------
lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 4 ++--
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 18 +++++++++---------
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 2 +-
lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | 12 ++++++------
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 14 +++++++-------
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 89 +++++++++++++++++++++++++++++++++++++++++++----------------------------------------------
lib/CodeGen/SelectionDAG/TargetLowering.cpp | 6 +++---
lib/Transforms/InstCombine/InstCombineCalls.cpp | 6 ++++--
lib/Transforms/Scalar/GVN.cpp | 48 ++++++++++++++++++++++++++++++------------------
lib/Transforms/Scalar/SROA.cpp | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------
lib/Transforms/Scalar/ScalarReplAggregates.cpp | 18 +++++++++++-------
lib/VMCore/DataLayout.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++++-------------------
lib/VMCore/IRBuilder.cpp | 23 ++++++++++++++++++-----
lib/VMCore/ValueTypes.cpp | 2 ++
lib/VMCore/Verifier.cpp | 2 ++
test/CodeGen/PowerPC/structsinmem.ll | 8 ++++----
test/CodeGen/PowerPC/structsinregs.ll | 14 +++++++-------
test/CodeGen/X86/memcpy-2.ll | 4 ++--
test/CodeGen/X86/pr11985.ll | 6 +++---
test/CodeGen/X86/unaligned-load.ll | 10 +++++++++-
33 files changed, 506 insertions(+), 326 deletions(-)