================
@@ -0,0 +1,130 @@
+; -stats requires asserts
+; REQUIRES: asserts
+
+; Check that we can still devirtualize outside LTO mode
+; Check that we skip devirtualization for empty functions outside LTO mode
+
+; RUN: opt -S -passes=wholeprogramdevirt -wholeprogramdevirt-nolto 
-pass-remarks=wholeprogramdevirt -stats %s 2>&1 | FileCheck %s
+
+target datalayout = "e-p:64:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+; CHECK: remark: devirt-single.cc:30:32: single-impl: devirtualized a call to 
vf
+; CHECK: remark: devirt-single.cc:41:32: single-impl: devirtualized a call to 
vf
+; CHECK: remark: devirt-single.cc:51:32: single-impl: devirtualized a call to 
vf
+; CHECK: remark: devirt-single.cc:13:0: devirtualized vf
+; CHECK-NOT: devirtualized
+
+@vt1 = constant [1 x ptr] [ptr @vf], !type !8
+@vt2 = constant [1 x ptr] [ptr @vf_empty], !type !12
+
+define i1 @vf(ptr %this) #0 !dbg !7 {
+  ret i1 true
+}
+
+; This should NOT be devietualized because during non-lto empty functions
----------------
hassnaaHamdi wrote:

fixed

https://github.com/llvm/llvm-project/pull/145031
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to