[PATCH] D70496: [AArch64] Fix issues with large arrays on stack

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 07:57:42 PST 2019


kiranchandramohan created this revision.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.

This patch fixes a few issues when large arrays are allocated on the stack. Currently, clang has inconsistent behaviour, for debug builds there is an assertion failure when the array size on stack is around 2GB but there is no assertion when the stack is around 8GB. For release builds there is no assertion, the compilation succeeds but generates incorrect code. The incorrect code generated is due to using int/unsigned int instead of their 64-bit counterparts. This patch,

1. Removes the assertion in frame legality check.
2. Converts int/unsigned int in some places to the 64-bit variants. This helps in generating correct code and removes the inconsistent behaviour.
3. Adds a test which runs without optimisations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70496

Files:
  llvm/include/llvm/CodeGen/MachineFrameInfo.h
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/lib/CodeGen/MachineFrameInfo.cpp
  llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
  llvm/lib/Target/AArch64/AArch64FrameLowering.h
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
  llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
  llvm/test/CodeGen/AArch64/large-stack.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70496.230267.patch
Type: text/x-patch
Size: 16525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191120/561cda27/attachment-0001.bin>


More information about the llvm-commits mailing list