[PATCH] AArch64: Safely handle the incoming sret call argument.
Andrew Trick
atrick at apple.com
Thu Feb 12 15:02:18 PST 2015
This adds a safe interface to the machine independent InputArg
struct for accessing the index of the original (IR-level)
argument. When a non-native return type is lowered, we generate
the hidden machine-level sret argument on-the-fly. Before this
fix, we were representing this argument as OrigArgIndex == 0,
which is an outright lie. In particular this crashed in the
AArch64 backend where we actually try to access the type of the
original argument.
Now we use a sentinel value for machine arguments that have no
original argument index. AArch64, Mips, and PPC now check for
this case before accessing the original argument.
Fixes <rdar://19792160> Null pointer assertion in AArch64TargetLowering
---
include/llvm/Target/TargetCallingConv.h | 11 +++++++++++
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 3 ++-
lib/Target/AArch64/AArch64ISelLowering.cpp | 23 ++++++++++++-----------
lib/Target/ARM/ARMISelLowering.cpp | 4 ++--
lib/Target/Mips/MipsCCState.cpp | 4 ++--
lib/Target/Mips/MipsISelLowering.cpp | 7 +++++--
lib/Target/PowerPC/PPCISelLowering.cpp | 18 ++++++++++++------
lib/Target/R600/R600ISelLowering.cpp | 2 +-
lib/Target/R600/SIISelLowering.cpp | 6 +++---
test/CodeGen/AArch64/implicit-sret.ll | 13 +++++++++++++
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AArch64-Safely-handle-the-incoming-sret-call-argumen.patch
Type: application/octet-stream
Size: 12692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150212/7efcbdaa/attachment.obj>
More information about the llvm-commits
mailing list