[llvm] [AMDGPU] Prevent hang in SIFoldOperands (PR #82099)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 07:23:27 PST 2024


choikwa wrote:

So I did more digging and the search yielded some interesting findings. It turns out that the early_inc iterator (I hand-converted) was incrementing and returning previous use operand iterator after going through foldOperand call. And the reason I think has to do with tryAddToFoldList at the end of foldOperand calling commuteInstruction. There may be some weird interaction going on with commuting the operands for V_MUL instructions and iterating use operands of REG_SEQUENCE that affects the iterator increment to cause infinite loop. It doesn't look like this interaction is intentional -- disabling commutation prevents the infinite loop. Perhaps option to disable commuting in tryAddToFoldList is the answer?

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


More information about the llvm-commits mailing list