Skip to content

Commit 076392b

Browse files
authored
[SPARC] Fix regression from UpgradeDataLayoutString change (#110608)
It turns out that we cannot rely on the presence of `-i64:64` as a position reference when adding the `-i128:128` datalayout string due to some custom datalayout strings lacking it (e.g ones used by bugpoint, among other things). Do not add the `-i128:128` string in that case. This fixes the regression introduced in #106951.
1 parent 41eb186 commit 076392b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/IR/AutoUpgrade.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5523,8 +5523,8 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
55235523
std::string I128 = "-i128:128";
55245524
if (!StringRef(Res).contains(I128)) {
55255525
size_t Pos = Res.find(I64);
5526-
assert(Pos != size_t(-1) && "no i64 data layout found!");
5527-
Res.insert(Pos + I64.size(), I128);
5526+
if (Pos != size_t(-1))
5527+
Res.insert(Pos + I64.size(), I128);
55285528
}
55295529
return Res;
55305530
}

0 commit comments

Comments
 (0)