[llvm] [ValueTracking] Fix "getOperand() out of range!" assertion crash (PR #87482)

Vedant Paranjape via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 22:32:10 PDT 2024


vedantparanjape-amd wrote:

> > > Not sure this is really the right fix. If a function has a noundef attribute on the return value, then it cannot have a void return. This looks more like a context problem, in that we're dealing with two different functions during inlining.
> > 
> > 
> > I suspected this, but the LangRef for noundef isn't really clear on this aspect: https://llvm.org/docs/LangRef.html. It's not mentioned anywhere that noundef attribute on the return value means it can't have a void return.
> 
> Yeah, this is not spelled out in LangRef, but it's verified here:
> 
> https://github.com/llvm/llvm-project/blob/4ae33c52f794dbd64924dd006570cdc409c297bc/llvm/lib/IR/Attributes.cpp#L2067-L2071

I see, this fix is just a workaround. noundef should not apply to the inlined function as such, as in atleast for ret instructions.

https://github.com/llvm/llvm-project/pull/87482


More information about the llvm-commits mailing list