Skip to content

Commit c09e145

Browse files
Rollup merge of rust-lang#157365 - zmodem:revert_assign_guids, r=cuviper
Revert "LLVM 23: Run AssignGUIDPass in some places" This reverts commit cdb73bb. The LLVM side change was reverted.
2 parents 26eadc1 + 4919940 commit c09e145

22 files changed

Lines changed: 35 additions & 44 deletions

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@
4949
#include "llvm/Transforms/Instrumentation/RealtimeSanitizer.h"
5050
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
5151
#include "llvm/Transforms/Scalar/AnnotationRemarks.h"
52-
#if LLVM_VERSION_GE(23, 0)
53-
#include "llvm/Transforms/Utils/AssignGUID.h"
54-
#endif
5552
#include "llvm/Transforms/Utils/CanonicalizeAliases.h"
5653
#include "llvm/Transforms/Utils/FunctionImportUtils.h"
5754
#include "llvm/Transforms/Utils/NameAnonGlobals.h"
@@ -918,9 +915,6 @@ extern "C" LLVMRustResult LLVMRustOptimize(
918915
if (NeedThinLTOBufferPasses) {
919916
MPM.addPass(CanonicalizeAliasesPass());
920917
MPM.addPass(NameAnonGlobalPass());
921-
#if LLVM_VERSION_GE(23, 0)
922-
MPM.addPass(AssignGUIDPass());
923-
#endif
924918
}
925919
// For `-Copt-level=0`, and the pre-link fat/thin LTO stages.
926920
if (ThinLTOBufferRef && *ThinLTOBufferRef == nullptr) {
@@ -1460,9 +1454,6 @@ extern "C" LLVMRustBuffer *LLVMRustModuleSerialize(LLVMModuleRef M,
14601454
PB.registerLoopAnalyses(LAM);
14611455
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
14621456
ModulePassManager MPM;
1463-
#if LLVM_VERSION_GE(23, 0)
1464-
MPM.addPass(AssignGUIDPass());
1465-
#endif
14661457
MPM.addPass(ThinLTOBitcodeWriterPass(OS, nullptr));
14671458
MPM.run(*unwrap(M), MAM);
14681459
} else {

tests/codegen-llvm/bpf-allows-unaligned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#[no_mangle]
77
#[target_feature(enable = "allows-misaligned-mem-access")]
8-
// CHECK: define noundef zeroext i8 @foo(i8 noundef returned %arg) unnamed_addr #0
8+
// CHECK: define noundef zeroext i8 @foo(i8 noundef returned %arg) unnamed_addr #0 {
99
pub unsafe fn foo(arg: u8) -> u8 {
1010
arg
1111
}

tests/codegen-llvm/branch-protection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern crate minicore;
2222
use minicore::*;
2323

2424
// A basic test function.
25-
// CHECK: @test(){{.*}} [[ATTR:#[0-9]+]]
25+
// CHECK: @test(){{.*}} [[ATTR:#[0-9]+]] {
2626
#[no_mangle]
2727
pub fn test() {}
2828

tests/codegen-llvm/frame-pointer-cli-control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Specific cases where platforms or tools rely on frame pointers for sound or corr
4545

4646
extern crate minicore;
4747

48-
// CHECK: i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]]
48+
// CHECK: i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
4949
#[no_mangle]
5050
pub fn peach(x: u32) -> u32 {
5151
x

tests/codegen-llvm/frame-pointer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
extern crate minicore;
1919
use minicore::*;
2020

21-
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]]
21+
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
2222
#[no_mangle]
2323
pub fn peach(x: u32) -> u32 {
2424
x

tests/codegen-llvm/gpu-convergent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern "C" {
1717
fn ext();
1818
}
1919

20-
// CHECK: define {{.*}}_kernel void @fun(i32{{.*}}) unnamed_addr #[[ATTR:[0-9]+]]
20+
// CHECK: define {{.*}}_kernel void @fun(i32{{.*}}) unnamed_addr #[[ATTR:[0-9]+]] {
2121
// CHECK: declare void @ext() unnamed_addr #[[ATTR]]
2222
// CHECK: attributes #[[ATTR]] = {{.*}} convergent
2323
#[no_mangle]

tests/codegen-llvm/instrument-coverage/testprog.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ fn main() {
101101
// CHECK-SAME: @__llvm_prf_nm
102102
// CHECK-SAME: section "llvm.metadata"
103103

104-
// CHECK: define internal { {{.*}} } @_R{{[a-zA-Z0-9_]+}}testprog14will_be_called() unnamed_addr #{{[0-9]+}}
104+
// CHECK: define internal { {{.*}} } @_R{{[a-zA-Z0-9_]+}}testprog14will_be_called() unnamed_addr #{{[0-9]+}} {
105105
// CHECK-NEXT: start:
106106
// CHECK-NOT: define internal
107107
// CHECK: atomicrmw add ptr
108108
// CHECK-SAME: @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called,
109109

110110
// CHECK: declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #[[LLVM_INSTRPROF_INCREMENT_ATTR:[0-9]+]]
111111

112-
// WIN: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() #[[LLVM_PROFILE_RUNTIME_USER_ATTR:[0-9]+]] comdat {{.*}}
112+
// WIN: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() #[[LLVM_PROFILE_RUNTIME_USER_ATTR:[0-9]+]] comdat {{.*}}{
113113
// WIN-NEXT: %1 = load i32, ptr @__llvm_profile_runtime
114114
// WIN-NEXT: ret i32 %1
115115
// WIN-NEXT: }

tests/codegen-llvm/link_section.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub static VAR2: E = E::A(666);
2929
#[link_section = "__TEST,three"]
3030
pub static VAR3: E = E::B(1.);
3131

32-
// CHECK: define {{(dso_local )?}}void @fn1() {{.*}} section "__TEST,four"
32+
// CHECK: define {{(dso_local )?}}void @fn1() {{.*}} section "__TEST,four" {
3333
#[no_mangle]
3434
#[link_section = "__TEST,four"]
3535
pub fn fn1() {}

tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77

88
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
99
// CHECK-LABEL: define{{.*}}foo
10-
// CHECK-SAME: {{.*}}!type ![[TYPE1:[0-9]+]]
10+
// CHECK-SAME: {{.*}}![[TYPE1:[0-9]+]]
1111
// CHECK: call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_E.normalized.generalized")
1212
f(arg)
1313
}
1414

1515
pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
1616
// CHECK-LABEL: define{{.*}}bar
17-
// CHECK-SAME: {{.*}}!type ![[TYPE2:[0-9]+]]
17+
// CHECK-SAME: {{.*}}![[TYPE2:[0-9]+]]
1818
// CHECK: call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.normalized.generalized")
1919
f(arg1, arg2)
2020
}
2121

2222
pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
2323
// CHECK-LABEL: define{{.*}}baz
24-
// CHECK-SAME: {{.*}}!type ![[TYPE3:[0-9]+]]
24+
// CHECK-SAME: {{.*}}![[TYPE3:[0-9]+]]
2525
// CHECK: call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.normalized.generalized")
2626
f(arg1, arg2, arg3)
2727
}

tests/codegen-llvm/some-non-zero-from-atomic-optimization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub unsafe fn some_non_zero_from_atomic_get() -> Option<NonZeroUsize> {
7272
///
7373
/// The way we check that the LLVM IR is correct is by making sure that neither
7474
/// `panic` nor `unreachable` is part of the LLVM IR:
75-
// CHECK-LABEL: define {{.*}} i64 @some_non_zero_from_atomic_get2() {{.*}}
75+
// CHECK-LABEL: define {{.*}} i64 @some_non_zero_from_atomic_get2() {{.*}} {
7676
// CHECK-NOT: panic
7777
// CHECK-NOT: unreachable
7878
#[no_mangle]

0 commit comments

Comments
 (0)