[PATCH] D30227: AMDGPU: Change m0 initialization handling to help LDS

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 17:34:14 PST 2017


tony-tye added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:3791-3792
+                                          const DebugLoc &DL) const {
+  // TODO: Restrict to compile time LDS size or initialize with dynamic size
+  // from register?
+  BuildMI(MBB, I, DL, get(AMDGPU::S_MOV_B32), AMDGPU::M0)
----------------
I would say neither. We want to totally disable the bounds checking for normal code, hence the MAXINT value seems the best choice.

An address sanitizer may want to insert range check code and pay the performance cost. But this would be on a per variable basis, not on the entire LDS. The hardware ensures that one wave cannot corrupt the LDS of another work-group regardless of M0 value.


https://reviews.llvm.org/D30227





More information about the llvm-commits mailing list