From ff060415741678824227c6b3a1c87b75352c6057 Mon Sep 17 00:00:00 2001 From: Yuri Iozzelli Date: Tue, 20 Aug 2024 13:01:51 +0200 Subject: [PATCH] fix(Writer): treat ascast as bitcast for inlining --- llvm/lib/CheerpUtils/Utility.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CheerpUtils/Utility.cpp b/llvm/lib/CheerpUtils/Utility.cpp index ee990616456c..163d2a84256b 100644 --- a/llvm/lib/CheerpUtils/Utility.cpp +++ b/llvm/lib/CheerpUtils/Utility.cpp @@ -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()) { @@ -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