Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 4088678

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:53d080c5b5df into amd-gfx:f0fbc982ed3b
Local branch amd-gfx f0fbc98 Merged main:93743ee56669 into amd-gfx:ab47d36e0ead Remote branch main 53d080c [mlir][Arith] Remove `arith-to-llvm` from `func-to-llvm` (llvm#120548)
2 parents f0fbc98 + 53d080c commit 4088678

File tree

22 files changed

+206
-32
lines changed

22 files changed

+206
-32
lines changed

bolt/lib/Core/BinaryContext.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,15 @@ void BinaryContext::printInstruction(raw_ostream &OS, const MCInst &Instruction,
19611961
OS << "\tjit\t" << MIB->getTargetSymbol(Instruction)->getName()
19621962
<< " # ID: " << DynamicID;
19631963
} else {
1964-
InstPrinter->printInst(&Instruction, 0, "", *STI, OS);
1964+
// If there are annotations on the instruction, the MCInstPrinter will fail
1965+
// to print the preferred alias as it only does so when the number of
1966+
// operands is as expected. See
1967+
// https://github.com/llvm/llvm-project/blob/782f1a0d895646c364a53f9dcdd6d4ec1f3e5ea0/llvm/lib/MC/MCInstPrinter.cpp#L142
1968+
// Therefore, create a temporary copy of the Inst from which the annotations
1969+
// are removed, and print that Inst.
1970+
MCInst InstNoAnnot = Instruction;
1971+
MIB->stripAnnotations(InstNoAnnot);
1972+
InstPrinter->printInst(&InstNoAnnot, 0, "", *STI, OS);
19651973
}
19661974
if (MIB->isCall(Instruction)) {
19671975
if (MIB->isTailCall(Instruction))

bolt/test/RISCV/call-annotations.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ f:
1616

1717
// CHECK-LABEL: Binary Function "_start" after building cfg {
1818
// CHECK: auipc ra, f
19-
// CHECK-NEXT: jalr ra, -0x4(ra) # Offset: 4
20-
// CHECK-NEXT: jal ra, f # Offset: 8
21-
// CHECK-NEXT: jal zero, f # TAILCALL # Offset: 12
19+
// CHECK-NEXT: jalr -0x4(ra) # Offset: 4
20+
// CHECK-NEXT: jal f # Offset: 8
21+
// CHECK-NEXT: j f # TAILCALL # Offset: 12
2222

2323
// CHECK-LABEL: Binary Function "long_tail" after building cfg {
2424
// CHECK: auipc t1, f
25-
// CHECK-NEXT: jalr zero, -0x18(t1) # TAILCALL # Offset: 8
25+
// CHECK-NEXT: jr -0x18(t1) # TAILCALL # Offset: 8
2626

2727
// CHECK-LABEL: Binary Function "compressed_tail" after building cfg {
2828
// CHECK: jr a0 # TAILCALL # Offset: 0

bolt/test/RISCV/relax.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// RUN: llvm-objdump -d %t.bolt | FileCheck --check-prefix=OBJDUMP %s
66

77
// CHECK: Binary Function "_start" after building cfg {
8-
// CHECK: jal ra, near_f
8+
// CHECK: jal near_f
99
// CHECK-NEXT: auipc ra, far_f
10-
// CHECK-NEXT: jalr ra, 0xc(ra)
10+
// CHECK-NEXT: jalr 0xc(ra)
1111
// CHECK-NEXT: j near_f
1212

1313
// CHECK: Binary Function "_start" after fix-riscv-calls {

bolt/test/RISCV/reloc-branch.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.p2align 1
88
// CHECK: Binary Function "_start" after building cfg {
99
_start:
10-
// CHECK: beq zero, zero, .Ltmp0
10+
// CHECK: beqz zero, .Ltmp0
1111
beq zero, zero, 1f
1212
nop
1313
// CHECK: .Ltmp0

bolt/test/RISCV/reloc-jal.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ f:
1414
.globl _start
1515
.p2align 1
1616
_start:
17-
// CHECK: jal ra, f
17+
// CHECK: jal f
1818
jal ra, f
1919
ret
2020
.size _start, .-_start

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,8 @@ Improvements to Clang's diagnostics
706706
return ptr + index < ptr; // warning
707707
}
708708
709+
- Fix -Wdangling false positives on conditional operators (#120206).
710+
709711
Improvements to Clang's time-trace
710712
----------------------------------
711713

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,15 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call,
582582
// Temp().ptr; // Here ptr might not dangle.
583583
if (isa<MemberExpr>(Arg->IgnoreImpCasts()))
584584
return;
585+
// Avoid false positives when the object is constructed from a conditional
586+
// operator argument. A common case is:
587+
// // 'ptr' might not be owned by the Owner object.
588+
// std::string_view s = cond() ? Owner().ptr : sv;
589+
if (const auto *Cond =
590+
dyn_cast<AbstractConditionalOperator>(Arg->IgnoreImpCasts());
591+
Cond && isPointerLikeType(Cond->getType()))
592+
return;
593+
585594
auto ReturnType = Callee->getReturnType();
586595

587596
// Once we initialized a value with a non gsl-owner reference, it can no

clang/test/Sema/warn-lifetime-analysis-nocfg.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,3 +777,32 @@ void test4() {
777777
}
778778

779779
} // namespace LifetimeboundInterleave
780+
781+
namespace GH120206 {
782+
struct S {
783+
std::string_view s;
784+
};
785+
786+
struct [[gsl::Owner]] Q1 {
787+
const S* get() const [[clang::lifetimebound]];
788+
};
789+
std::string_view test1(int c, std::string_view sv) {
790+
std::string_view k = c > 1 ? Q1().get()->s : sv;
791+
if (c == 1)
792+
return c > 1 ? Q1().get()->s : sv;
793+
Q1 q;
794+
return c > 1 ? q.get()->s : sv;
795+
}
796+
797+
struct Q2 {
798+
const S* get() const [[clang::lifetimebound]];
799+
};
800+
std::string_view test2(int c, std::string_view sv) {
801+
std::string_view k = c > 1 ? Q2().get()->s : sv;
802+
if (c == 1)
803+
return c > 1 ? Q2().get()->s : sv;
804+
Q2 q;
805+
return c > 1 ? q.get()->s : sv;
806+
}
807+
808+
} // namespace GH120206

llvm/Maintainers.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ [email protected] (email), [asb](https://github.com/asb) (GitHub)
251251

252252
#### Sparc backend
253253

254-
Venkatraman Govindaraju \
255-
[email protected] (email), [vegovin](https://github.com/vegovin) (GitHub)
254+
Koakuma \
255+
[email protected] (email), [koachan](https://github.com/koachan) (GitHub)
256256

257257
#### SPIRV backend
258258

@@ -320,16 +320,11 @@ [email protected] (email), [echristo](https://github.com/echristo) (GitHub)
320320
Benjamin Kramer \
321321
[email protected] (email), [d0k](https://github.com/d0k) (GitHub)
322322

323-
#### IR Linker
323+
#### IR Linker and LTO
324324

325325
Teresa Johnson \
326326
[email protected] (email), [teresajohnson](https://github.com/teresajohnson) (GitHub)
327327

328-
#### LTO
329-
330-
Peter Collingbourne \
331-
[email protected] (email), [pcc](https://github.com/pcc) (GitHub)
332-
333328
#### MCJIT, Orc, RuntimeDyld, PerfJITEvents
334329

335330
Lang Hames \
@@ -456,9 +451,11 @@ [email protected] (email), [lattner](https://github.com/lattner) (GitHub), clattn
456451
Paul C. Anagnostopoulos ([email protected], [Paul-C-Anagnostopoulos](https://github.com/Paul-C-Anagnostopoulos)) -- TableGen \
457452
Justin Bogner ([email protected], [bogner](https://github.com/bogner)) -- SelectionDAG \
458453
Chandler Carruth ([email protected], [email protected], [chandlerc](https://github.com/chandlerc)) -- ADT, Support \
454+
Peter Collingbourne ([email protected], [pcc](https://github.com/pcc)) -- LTO \
459455
Evan Cheng ([email protected]) -- Parts of code generator not covered by someone else \
460456
Jake Ehrlich ([email protected], [jakehehrlich](https://github.com/jakehehrlich)) -- llvm-objcopy and ObjCopy library \
461457
Renato Golin ([email protected], [rengolin](https://github.com/rengolin)) -- ARM backend \
458+
Venkatraman Govindaraju ([email protected], [vegovin](https://github.com/vegovin) -- Sparc backend \
462459
James Grosbach ([email protected]) -- MC layer \
463460
Anton Korobeynikov ([email protected], [asl](https://github.com/asl)) -- ARM EABI \
464461
Chad Rosier ([email protected]) -- FastISel \

llvm/include/llvm/Config/llvm-config.h.cmake

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

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 521731
19+
#define LLVM_MAIN_REVISION 522087
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

0 commit comments

Comments
 (0)