[compiler-rt] 51fab8f - Mark test function as 'weak' to prevent interprocedural CSE.

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 17:03:42 PDT 2020


Author: Richard Smith
Date: 2020-03-09T17:01:07-07:00
New Revision: 51fab8f36f47d84e0bcf00bdd711fd1b7739d134

URL: https://github.com/llvm/llvm-project/commit/51fab8f36f47d84e0bcf00bdd711fd1b7739d134
DIFF: https://github.com/llvm/llvm-project/commit/51fab8f36f47d84e0bcf00bdd711fd1b7739d134.diff

LOG: Mark test function as 'weak' to prevent interprocedural CSE.

A recent change to MemorySSA caused LLVM to start optimizing the call to
'f(x)' into just 'x', despite the 'noinline' attribute. So try harder to
prevent this optimization from firing.

Added: 
    

Modified: 
    compiler-rt/test/msan/no_sanitize_memory_prop.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/msan/no_sanitize_memory_prop.cpp b/compiler-rt/test/msan/no_sanitize_memory_prop.cpp
index bfd4194dd266..cf21c9464043 100644
--- a/compiler-rt/test/msan/no_sanitize_memory_prop.cpp
+++ b/compiler-rt/test/msan/no_sanitize_memory_prop.cpp
@@ -9,6 +9,7 @@
 #include <stdio.h>
 
 __attribute__((noinline))
+__attribute__((weak))
 __attribute__((no_sanitize_memory))
 int f(int x) {
   return x;


        


More information about the llvm-commits mailing list