From 95bc3ed03bf192e3e62278850101fb94d46ab660 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 16 Jan 2025 14:19:25 -0500 Subject: ioq: Don't unroll the spin loop --- src/bfs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/bfs.h') diff --git a/src/bfs.h b/src/bfs.h index af4cf9f..6c930ad 100644 --- a/src/bfs.h +++ b/src/bfs.h @@ -218,4 +218,15 @@ extern const char bfs_ldlibs[]; # define _target_clones(...) #endif +/** + * Optimization hint to not unroll a loop. + */ +#if __clang__ +# define _nounroll _Pragma("nounroll") +#elif __GNUC__ +# define _nounroll _Pragma("GCC unroll 0") +#else +# define _nounroll +#endif + #endif // BFS_H -- cgit v1.2.3