[inliner][bug] AddReturnAttributes crash with non existing operands #86162
Labels
llvm:optimizations
question
A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Hi,
I think we've hit the Inliner bug when using LLVM in PostgreSQL [1]. Here is
what happens:
It seems
CallBase
was identified to have some attributes, but oneReturnInst
doesn't have any operands to work with [2]. The instructionwe're talking about is the return instruction from the
outblock
in the deformfunction, which was generated via
LLVMBuildRetVoid
and is literallyret void
(I'll add the full function body at the end).The unfortunate part is that this started to crash only recently. My
understanding that the reason is this change [3], which has enabled
noundef
attributes propagation. It looks like
ret void
is considered to benoundef
(this is exactly the kind of an attribute that causes the crash), thus
ValidUB.hasAttributes()
now returns true and everything proceed further towork with operands. If I comment out
if (CB.hasRetAttr(Attribute::NoUndef))
condition everything works fine.
Any ideas how to fix that? Any other information necessary? I've tried to
experiment with excluding problematic ReturnInst from the loop, but it turns
out not only
getOperand
,getNumOperands
is also crashing. I'll try to comeup with an isolated test case, in the meantime if you folks are brave enough I
can show how to reproduce it directly on PostgreSQL.
Here is the full body of the deform function, the
outblock
is a cleanup codethat does
ret void
.The text was updated successfully, but these errors were encountered: