Author: Ying Yi
Date: 2025-08-28T16:49:16+01:00
New Revision: 111844a873b5d931fb72a53b16ba6bd2702a03d8

URL: 
https://github.com/llvm/llvm-project/commit/111844a873b5d931fb72a53b16ba6bd2702a03d8
DIFF: 
https://github.com/llvm/llvm-project/commit/111844a873b5d931fb72a53b16ba6bd2702a03d8.diff

LOG: [LTO] Enhance unified/nonunified LTO checks. (#148229)

For the PS targets, unified LTO pipeline is used as default behaviour when 
enabling LTO. Other targets use Distinct LTO pipeline behaviour as default 
behavious. Unified/nonunified LTO checks are enhanced in this PR:
1. Check that the default, unified, and non-unified behavior for 
asan-unified-lto.ll all match (irrespective of what the default 
unified/nonunified behavior is).
2. Check that the difference in behavior for 'unified' and 'full' runs is 
(regarding the passes) is what is expected (rather than simply that they are 
different).

Added: 
    

Modified: 
    clang/test/CodeGen/asan-unified-lto.ll
    clang/test/CodeGen/unified-lto-pipeline.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/asan-unified-lto.ll 
b/clang/test/CodeGen/asan-unified-lto.ll
index 7b790d49e3fdb..21734e1fd8f67 100644
--- a/clang/test/CodeGen/asan-unified-lto.ll
+++ b/clang/test/CodeGen/asan-unified-lto.ll
@@ -5,6 +5,7 @@
 
 ; RUN: %clang_cc1 -emit-llvm-bc -O1 -flto -fsanitize=address -o - -x ir < %s | 
llvm-dis -o - | FileCheck %s
 ; RUN: %clang_cc1 -emit-llvm-bc -O1 -flto -funified-lto -fsanitize=address -o 
- -x ir < %s | llvm-dis -o - | FileCheck %s
+; RUN: %clang_cc1 -emit-llvm-bc -O1 -flto -fno-unified-lto -fsanitize=address 
-o - -x ir < %s | llvm-dis -o - | FileCheck %s
 ; CHECK: @anon.3ee0898e5200a57350fed5485ae5d237
 
 target datalayout = 
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

diff  --git a/clang/test/CodeGen/unified-lto-pipeline.c 
b/clang/test/CodeGen/unified-lto-pipeline.c
index e13cd57eed67d..0e0c503256f0b 100644
--- a/clang/test/CodeGen/unified-lto-pipeline.c
+++ b/clang/test/CodeGen/unified-lto-pipeline.c
@@ -11,8 +11,10 @@
 /// Check that pass pipelines for thin, thin-unified, full-unified all match.
 // RUN: 
diff  %t.0.txt %t.1.txt
 // RUN: 
diff  %t.0.txt %t.2.txt
-/// Pass pipeline for full is 
diff erent.
-// RUN: not 
diff  %t.0.txt %t.3.txt
+/// Pass pipeline for full is 
diff erent. Unified uses the full Linux pipeline except 
ThinLTOBitcodeWriterPass vs BitcodeWriterPass.
+// RUN: not 
diff  -u %t.0.txt %t.3.txt | FileCheck %s --check-prefix=DIFF 
--implicit-check-not="{{^[-+!<>] }}"
+// DIFF:      -Running pass: ThinLTOBitcodeWriterPass
+// DIFF-NEXT: +Running pass: BitcodeWriterPass
 
 int foo() {
   return 2 + 2;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to