Skip to content

Commit 1e14380

Browse files
authored
Merge branch 'main' into users/rampitec/07-30-_amdgpu_add_v_cvt_sr_pk_bf8_fp8_f16_gfx1250_instructions
2 parents e117d35 + a8d0ae3 commit 1e14380

File tree

6 files changed

+337
-589
lines changed

6 files changed

+337
-589
lines changed

flang/docs/FortranStandardsSupport.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ status of all important Fortran 2023 features. The table entries are based on th
4040
| Conditional expressions and arguments | N | |
4141
| More use of boz constants | P | All usages other than enum are supported |
4242
| Intrinsics for extracting tokens from a string | N | |
43-
| Intrinsics for Trig functions that work in degrees | N | |
44-
| Intrinsics for Trig functions that work in half revolutions| N | |
43+
| Intrinsics for Trig functions that work in degrees | Y | |
44+
| Intrinsics for Trig functions that work in half revolutions| Y | |
4545
| Changes to system_clock | N | |
4646
| Changes for conformance with the new IEEE standard | Y | |
4747
| Additional named constants to specify kinds | Y | |
48-
| Extensions for c_f_pointer intrinsic | N | |
48+
| Extensions for c_f_pointer intrinsic | Y | |
4949
| Procedures for converting between fortran and c strings | N | |
5050
| The at edit descriptor | N | |
5151
| Control over leading zeros in output of real values | N | |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <limits.h>
2+
3+
int main() { return INT_MAX + 1; }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# RUN: %clang_host -g -O0 %S/Inputs/ubsan_add_overflow.c -o %t.out \
2+
# RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow
3+
4+
# RUN: %lldb -b -s %s %t.out | FileCheck %s
5+
6+
run
7+
# CHECK: thread #{{.*}} stop reason = Undefined Behavior Sanitizer: Integer addition overflowed
8+
# CHECK-NEXT: frame #1: {{.*}}`main at ubsan_add_overflow.c
9+
10+
bt
11+
# CHECK: frame #0: {{.*}}`__clang_trap_msg$Undefined Behavior Sanitizer$Integer addition overflowed{{.*}}
12+
# CHECK: frame #1: {{.*}}`main at ubsan_add_overflow.c
13+
14+
frame info
15+
# CHECK: frame #{{.*}}`main at ubsan_add_overflow.c
16+
17+
frame recognizer info 0
18+
# CHECK: frame 0 is recognized by Verbose Trap StackFrame Recognizer
19+
20+
quit

llvm/include/llvm/ADT/Any.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ class LLVM_ABI Any {
119119
template <class T> friend T any_cast(Any &&Value);
120120
template <class T> friend const T *any_cast(const Any *Value);
121121
template <class T> friend T *any_cast(Any *Value);
122-
template <typename T> friend bool any_isa(const Any &Value);
123122

124123
std::unique_ptr<StorageBase> Storage;
125124
};

llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp

Lines changed: 2 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -413,116 +413,6 @@ static bool isTlsAddressCode(uint8_t DW_OP_Code) {
413413
DW_OP_Code == dwarf::DW_OP_GNU_push_tls_address;
414414
}
415415

416-
static void constructSeqOffsettoOrigRowMapping(
417-
CompileUnit &Unit, const DWARFDebugLine::LineTable &LT,
418-
DenseMap<size_t, unsigned> &SeqOffToOrigRow) {
419-
420-
// Use std::map for ordered iteration.
421-
std::map<uint64_t, unsigned> LineTableMapping;
422-
423-
// First, trust the sequences that the DWARF parser did identify.
424-
for (const DWARFDebugLine::Sequence &Seq : LT.Sequences)
425-
LineTableMapping[Seq.StmtSeqOffset] = Seq.FirstRowIndex;
426-
427-
// Second, manually find sequence boundaries and match them to the
428-
// sorted attributes to handle sequences the parser might have missed.
429-
auto StmtAttrs = Unit.getStmtSeqListAttributes();
430-
llvm::sort(StmtAttrs, [](const PatchLocation &A, const PatchLocation &B) {
431-
return A.get() < B.get();
432-
});
433-
434-
std::vector<size_t> SeqStartRows;
435-
SeqStartRows.push_back(0);
436-
for (auto [I, Row] : llvm::enumerate(ArrayRef(LT.Rows).drop_back()))
437-
if (Row.EndSequence)
438-
SeqStartRows.push_back(I + 1);
439-
440-
// While SeqOffToOrigRow parsed from CU could be the ground truth,
441-
// e.g.
442-
//
443-
// SeqOff Row
444-
// 0x08 9
445-
// 0x14 15
446-
//
447-
// The StmtAttrs and SeqStartRows may not match perfectly, e.g.
448-
//
449-
// StmtAttrs SeqStartRows
450-
// 0x04 3
451-
// 0x08 5
452-
// 0x10 9
453-
// 0x12 11
454-
// 0x14 15
455-
//
456-
// In this case, we don't want to assign 5 to 0x08, since we know 0x08
457-
// maps to 9. If we do a dummy 1:1 mapping 0x10 will be mapped to 9
458-
// which is incorrect. The expected behavior is ignore 5, realign the
459-
// table based on the result from the line table:
460-
//
461-
// StmtAttrs SeqStartRows
462-
// 0x04 3
463-
// -- 5
464-
// 0x08 9 <- LineTableMapping ground truth
465-
// 0x10 11
466-
// 0x12 --
467-
// 0x14 15 <- LineTableMapping ground truth
468-
469-
ArrayRef StmtAttrsRef(StmtAttrs);
470-
ArrayRef SeqStartRowsRef(SeqStartRows);
471-
472-
// Dummy last element to make sure StmtAttrsRef and SeqStartRowsRef always
473-
// run out first.
474-
constexpr size_t DummyKey = UINT64_MAX;
475-
constexpr unsigned DummyVal = UINT32_MAX;
476-
LineTableMapping[DummyKey] = DummyVal;
477-
478-
for (auto [NextSeqOff, NextRow] : LineTableMapping) {
479-
auto StmtAttrSmallerThanNext = [NextSeqOff](const PatchLocation &SA) {
480-
return SA.get() < NextSeqOff;
481-
};
482-
auto SeqStartSmallerThanNext = [NextRow](const size_t &Row) {
483-
return Row < NextRow;
484-
};
485-
486-
// If both StmtAttrs and SeqStartRows points to value not in
487-
// the LineTableMapping yet, we do a dummy one to one mapping and
488-
// move the pointer.
489-
while (!StmtAttrsRef.empty() && !SeqStartRowsRef.empty() &&
490-
StmtAttrSmallerThanNext(StmtAttrsRef.front()) &&
491-
SeqStartSmallerThanNext(SeqStartRowsRef.front())) {
492-
SeqOffToOrigRow[StmtAttrsRef.consume_front().get()] =
493-
SeqStartRowsRef.consume_front();
494-
}
495-
// One of the pointer points to the value at or past Next in the
496-
// LineTableMapping, We move the pointer to re-align with the
497-
// LineTableMapping
498-
StmtAttrsRef = StmtAttrsRef.drop_while(StmtAttrSmallerThanNext);
499-
SeqStartRowsRef = SeqStartRowsRef.drop_while(SeqStartSmallerThanNext);
500-
// Use the LineTableMapping's result as the ground truth and move
501-
// on.
502-
if (NextSeqOff != DummyKey) {
503-
SeqOffToOrigRow[NextSeqOff] = NextRow;
504-
}
505-
// Move the pointers if they are pointed at Next.
506-
// It is possible that they point to later entries in LineTableMapping.
507-
// Therefore we only increment the pointers after we validate they are
508-
// pointing to the `Next` entry. e.g.
509-
//
510-
// LineTableMapping
511-
// SeqOff Row
512-
// 0x08 9 <- NextSeqOff/NextRow
513-
// 0x14 15
514-
//
515-
// StmtAttrs SeqStartRows
516-
// 0x14 13 <- StmtAttrsRef.front() / SeqStartRowsRef.front()
517-
// 0x16 15
518-
// -- 17
519-
if (!StmtAttrsRef.empty() && StmtAttrsRef.front().get() == NextSeqOff)
520-
StmtAttrsRef.consume_front();
521-
if (!SeqStartRowsRef.empty() && SeqStartRowsRef.front() == NextRow)
522-
SeqStartRowsRef.consume_front();
523-
}
524-
}
525-
526416
std::pair<bool, std::optional<int64_t>>
527417
DWARFLinker::getVariableRelocAdjustment(AddressesMap &RelocMgr,
528418
const DWARFDie &DIE) {
@@ -2407,12 +2297,8 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
24072297

24082298
// Create a map of stmt sequence offsets to original row indices.
24092299
DenseMap<uint64_t, unsigned> SeqOffToOrigRow;
2410-
// The DWARF parser's discovery of sequences can be incomplete. To
2411-
// ensure all DW_AT_LLVM_stmt_sequence attributes can be patched, we
2412-
// build a map from both the parser's results and a manual
2413-
// reconstruction.
2414-
if (!LT->Rows.empty())
2415-
constructSeqOffsettoOrigRowMapping(Unit, *LT, SeqOffToOrigRow);
2300+
for (const DWARFDebugLine::Sequence &Seq : LT->Sequences)
2301+
SeqOffToOrigRow[Seq.StmtSeqOffset] = Seq.FirstRowIndex;
24162302

24172303
// Create a map of original row indices to new row indices.
24182304
DenseMap<size_t, size_t> OrigRowToNewRow;

0 commit comments

Comments
 (0)