diff options
author | Dylan McKay <me@dylanmckay.io> | 2019-05-21 06:38:02 +0000 |
---|---|---|
committer | Dylan McKay <me@dylanmckay.io> | 2019-05-21 06:38:02 +0000 |
commit | e967308da43213c9c61696d77897f1d5dbc9eb94 (patch) | |
tree | d57fd26b0121f8aae24ae1aa21ae5bb3ac0c43af /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 690fa1b51beb7520b224ee4c9cb7c90d3bbe94e0 (diff) | |
download | bcm5719-llvm-e967308da43213c9c61696d77897f1d5dbc9eb94.tar.gz bcm5719-llvm-e967308da43213c9c61696d77897f1d5dbc9eb94.zip |
Add TargetLoweringInfo hook for explicitly setting the ABI calling convention endianess
Summary:
The endianess used in the calling convention does not always match the
endianess of the target on all architectures, namely AVR.
When an argument is too large to be legalised by the architecture and is
split for the ABI, a new hook TargetLoweringInfo::shouldSplitFunctionArgumentsAsLittleEndian
is queried to find the endianess that function arguments must be laid
out in.
This approach was recommended by Eli Friedman.
Originally reported in https://github.com/avr-rust/rust/issues/129.
Patch by Carl Peto.
Reviewers: bogner, t.p.northover, RKSimon, niravd, efriedma
Reviewed By: efriedma
Subscribers: JDevlieghere, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62003
llvm-svn: 361222
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index ab6b7a7398e..f07180a2faa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -5920,7 +5920,7 @@ bool TargetLowering::expandMULO(SDNode *Node, SDValue &Result, // being a legal type for the architecture and thus has to be split to // two arguments. SDValue Ret; - if (DAG.getDataLayout().isLittleEndian()) { + if (shouldSplitFunctionArgumentsAsLittleEndian(DAG.getDataLayout())) { // Halves of WideVT are packed into registers in different order // depending on platform endianness. This is usually handled by // the C calling convention, but we can't defer to it in |