Skip to content

Commit

Permalink
[SPARC] Fix regression from UpgradeDataLayoutString change (llvm#110608)
Browse files Browse the repository at this point in the history
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
llvm#106951.
  • Loading branch information
koachan authored and xgupta committed Oct 4, 2024
1 parent aef8d3c commit 586395b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/IR/AutoUpgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5523,8 +5523,8 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
std::string I128 = "-i128:128";
if (!StringRef(Res).contains(I128)) {
size_t Pos = Res.find(I64);
assert(Pos != size_t(-1) && "no i64 data layout found!");
Res.insert(Pos + I64.size(), I128);
if (Pos != size_t(-1))
Res.insert(Pos + I64.size(), I128);
}
return Res;
}
Expand Down

0 comments on commit 586395b

Please sign in to comment.