Skip to content

Commit

Permalink
fix(Writer): treat ascast as bitcast for inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri91 committed Oct 18, 2024
1 parent 2937e99 commit 15279c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/CheerpUtils/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ bool InlineableCache::isInlineableImpl(const Instruction& I)
// Split regular, regular, and byte layout are always inlined.
return true;
}
else if(I.getOpcode()==Instruction::BitCast)
else if(I.getOpcode()==Instruction::BitCast || I.getOpcode()==Instruction::AddrSpaceCast)
{
if (!I.getType()->isPointerTy())
{
Expand Down Expand Up @@ -388,6 +388,7 @@ bool InlineableCache::isInlineableImpl(const Instruction& I)
// Reached the direct user
if(!nextInst->hasOneUse() &&
(nextInst->getOpcode() == Instruction::BitCast ||
nextInst->getOpcode() == Instruction::AddrSpaceCast ||
nextInst->getOpcode() == Instruction::Trunc))
{
// Avoid interacting with the bitcast/trunc logic for now
Expand Down

0 comments on commit 15279c1

Please sign in to comment.