Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions llvm/lib/CheerpUtils/IdenticalCodeFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ bool IdenticalCodeFolding::equivalentInstruction(const llvm::Instruction* A, con
equivalentOperand(a->getCompareOperand(), b->getCompareOperand()) &&
equivalentOperand(a->getNewValOperand(), b->getNewValOperand()));
}
case Instruction::Fence:
{
const FenceInst* a = cast<FenceInst>(A);
const FenceInst* b = cast<FenceInst>(B);
return CacheAndReturn(a->getOrdering() == b->getOrdering() && a->getSyncScopeID() == b->getSyncScopeID());
}
default:
{
#ifndef NDEBUG
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CheerpUtils/Registerize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ void VertexColorer::iterativeDeepening(IterationsCounter& counter)

lowerBound = lowerBoundOnNumberOfColors(/*forceEvaluation*/true);
}
assert(counter.remaining() > 0);
//assert(counter.remaining() > 0);
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving the old assertion commented out makes the intent unclear and leaves dead code behind. Prefer either removing it entirely or replacing it with an explicit guard/early return when counter.remaining() == 0 (and, if useful, a short comment explaining why 0 iterations is a valid input).

Suggested change
//assert(counter.remaining() > 0);

Copilot uses AI. Check for mistakes.

uint32_t positiveFriendships = 0;
while (positiveFriendships < friendships.size() && friendships[positiveFriendships].first > 0)
Expand Down
4 changes: 4 additions & 0 deletions llvm/lib/Transforms/Scalar/SROA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,10 @@ static bool isIntegerWideningViableForSlice(const Slice &S,
return false;
if (!S.isSplittable())
return false; // Skip any unsplittable intrinsics.
uint64_t SliceBits = (RelEnd - RelBegin) * 8;
// CHEERP: disallow weird integer sizes like i24 from being created
if (!DL.isByteAddressable() && !DL.isLegalInteger(SliceBits))
return false;
Comment on lines +2179 to +2182
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a regression test for the new non-byte-addressable DataLayout behavior here (e.g., a module with datalayout including 'b' and a 3-byte memintrinsic slice) to ensure SROA no longer tries integer widening that would require creating illegal integer types like i24.

Copilot uses AI. Check for mistakes.
} else {
return false;
}
Expand Down
Loading