[llvm] [ASAN][AMDGPU] Make address sanitizer checks more efficient for the divergent target. (PR #72247)

Valery Pykhtin via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 03:25:49 PST 2023


================
@@ -1758,7 +1786,15 @@ void AddressSanitizer::instrumentAddress(Instruction *OrigIns,
   size_t Granularity = 1ULL << Mapping.Scale;
   Instruction *CrashTerm = nullptr;
 
-  if (ClAlwaysSlowPath || (TypeStoreSize < 8 * Granularity)) {
+  bool GenSlowPath = (ClAlwaysSlowPath || (TypeStoreSize < 8 * Granularity));
+
+  if (TargetTriple.isAMDGPU()) {
+    if (GenSlowPath) {
----------------
vpykhtin wrote:

Not really because of the CFG flattening. _If/then_ for report block is created the same either for the condition requiring "slow path" check (it is anded with the loaded shadow memory byte check) or for the condition on the "fast path".

https://github.com/llvm/llvm-project/pull/72247


More information about the llvm-commits mailing list