[PATCH] D60772: [AMDGPU] Add optional bounds checking for scratch accesses

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 07:55:24 PDT 2019


critson added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInsertScratchBounds.cpp:341-342
+    const MachineFrameInfo &FrameInfo = MF.getFrameInfo();
+    const int64_t ScratchSizeEstimate =
+      (int64_t) FrameInfo.estimateStackSize(MF);
+
----------------
arsenm wrote:
> This isn't going to be strong enough to guarantee that there will never be an out of bounds access.
> 
> This approach also isn't going to work in a callable function, in the presence of calls, or variable sized stack objects (which I'm planning on implementing)
On that basis do you have any opinions on the appropriate method for establishing stack size going forward?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60772/new/

https://reviews.llvm.org/D60772





More information about the llvm-commits mailing list