https://github.com/MaggieYingYi updated https://github.com/llvm/llvm-project/pull/148229
>From c1a8e6af4e7e87ccc10ae282763925e16716b8fa Mon Sep 17 00:00:00 2001 From: Ying Yi <ying...@sony.com> Date: Mon, 9 Jun 2025 11:14:24 +0100 Subject: [PATCH] [LTO] Enhance unified/nonunified LTO checks. 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). --- clang/test/CodeGen/asan-unified-lto.ll | 1 + clang/test/CodeGen/unified-lto-pipeline.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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 different. -// RUN: not diff %t.0.txt %t.3.txt +/// Pass pipeline for full is different. 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