[PATCH] AArch64: Safely handle the incoming sret call argument.

Andrew Trick atrick at apple.com
Fri Feb 13 17:36:52 PST 2015


On Feb 12, 2015, at 3:02 PM, Andrew Trick <atrick at apple.com> wrote:
> 
> 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 +++++++++++++
> 	
> <0001-AArch64-Safely-handle-the-incoming-sret-call-argumen.patch>

It looks like the patch I attached yesterday did not include changes to the ARM target. Here’s the complete patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AArch64-Safely-handle-the-incoming-sret-call-argumen.patch
Type: application/octet-stream
Size: 13633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150213/a4f0e587/attachment.obj>


More information about the llvm-commits mailing list