[Git][ghc/ghc][master] compiler: Don't attempt to TSAN-instrument SIMD operations

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Dec 10 19:02:30 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
e745e3a3 by Ben Gamari at 2024-12-10T14:01:59-05:00
compiler: Don't attempt to TSAN-instrument SIMD operations

TSAN only provides instrumentation for 8, 16, 32, and 64-bit memory
loads/stores. Don't attempt to instrument wider operations.

Fixes #25563.

- - - - -


1 changed file:

- compiler/GHC/Cmm/ThreadSanitizer.hs


Changes:

=====================================
compiler/GHC/Cmm/ThreadSanitizer.hs
=====================================
@@ -209,8 +209,9 @@ tsanTarget fn formals args =
 tsanStore :: Env
           -> CmmType -> CmmExpr
           -> Block CmmNode O O
-tsanStore env ty addr =
-    mkUnsafeCall env ftarget [] [addr]
+tsanStore env ty addr
+  | typeWidth ty < W128 = mkUnsafeCall env ftarget [] [addr]
+  | otherwise           = emptyBlock
   where
     ftarget = tsanTarget fn [] [AddrHint]
     w = widthInBytes (typeWidth ty)
@@ -219,8 +220,9 @@ tsanStore env ty addr =
 tsanLoad :: Env
          -> AlignmentSpec -> CmmType -> CmmExpr
          -> Block CmmNode O O
-tsanLoad env align ty addr =
-    mkUnsafeCall env ftarget [] [addr]
+tsanLoad env align ty addr
+  | typeWidth ty < W128  = mkUnsafeCall env ftarget [] [addr]
+  | otherwise            = emptyBlock
   where
     ftarget = tsanTarget fn [] [AddrHint]
     w = widthInBytes (typeWidth ty)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e745e3a30670440c9cf65450835d4eddada784eb

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e745e3a30670440c9cf65450835d4eddada784eb
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241210/62f90a48/attachment-0001.html>


More information about the ghc-commits mailing list