clang: work around asm input constraint problems
[linux-block.git] / include / linux / compiler-clang.h
index 49feac0162a5264a5b63b4a5e913bd821ccc66c3..4c1a39dcb624e9918dbaed72bf0c01bd0944b2df 100644 (file)
 
 #define __diag_ignore_all(option, comment) \
        __diag_clang(13, ignore, option)
+
+/*
+ * clang has horrible behavior with "g" or "rm" constraints for asm
+ * inputs, turning them into something worse than "m". Avoid using
+ * constraints with multiple possible uses (but "ir" seems to be ok):
+ *
+ *     https://github.com/llvm/llvm-project/issues/20571
+ */
+#define ASM_INPUT_G "ir"
+#define ASM_INPUT_RM "r"