Sankisa, Krishna (Chaitanya) via llvm-dev
2021-Dec-18 18:24 UTC
[llvm-dev] Issue with [InstCombine] Canonicalize range test idiom [D113366]
[AMD Official Use Only] Hi, https://reviews.llvm.org/D113366 and https://github.com/llvm/llvm-project/commit/1376301c87274bccf5565eb892173442782b1de3 The above change causes a soft hang for the below IR in InstCombine Transform. define i32 @p0(i32 %CF_init) { %t0 = add i32 %CF_init, -3 %t1 = icmp ugt i32 %t0, 1 %t2 = select i1 %t1, i32 -3, i32 1 ret i32 %t2 } tryToReuseConstantFromSelectInComparison() from InstCombineSelect.cpp will replace select with inverse icmp and select. 1376301c8727 change when it sees a icmp ugt will replace with icmp ult. InstCombinerImpl::run() in InstructionCombining.cpp, will run these transforms in a loop and it never ends. This is causing soft hang. icmp ugt is always transformed to icmp ult. Issue is with this transform. Commenting out the change fixes the soft hang issue. Any suggestion on other ways of fixing this in InstructionCombining transform pass? Regards, Chaitanya -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211218/c4e2049a/attachment.html>
Sanjay Patel via llvm-dev
2021-Dec-20 18:39 UTC
[llvm-dev] Issue with [InstCombine] Canonicalize range test idiom [D113366]
This problem was also reported as: https://github.com/llvm/llvm-project/issues/52684 ...and should be fixed with: https://github.com/llvm/llvm-project/commit/bb2fc19c6355d990a4cfb94be20528fbe37950a8 <https://reviews.llvm.org/rGbb2fc19c6355> On Sat, Dec 18, 2021 at 1:24 PM Sankisa, Krishna (Chaitanya) via llvm-dev < llvm-dev at lists.llvm.org> wrote:> [AMD Official Use Only] > > Hi, > > https://reviews.llvm.org/D113366 and > https://github.com/llvm/llvm-project/commit/1376301c87274bccf5565eb892173442782b1de3 > > > The above change causes a soft hang for the below IR in InstCombine > Transform. > > define i32 @p0(i32 %CF_init) { > %t0 = add i32 %CF_init, -3 > %t1 = icmp ugt i32 %t0, 1 > %t2 = select i1 %t1, i32 -3, i32 1 > ret i32 %t2 > } > > tryToReuseConstantFromSelectInComparison() from InstCombineSelect.cpp will > replace select with inverse icmp and select. 1376301c8727 change when it > sees a icmp ugt will replace with icmp ult. InstCombinerImpl::run() in > InstructionCombining.cpp, will run these transforms in a loop and it never > ends. This is causing soft hang. > > icmp ugt is always transformed to icmp ult. Issue is with this transform. > Commenting out the change fixes the soft hang issue. > Any suggestion on other ways of fixing this in InstructionCombining > transform pass? > > > Regards, > Chaitanya > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211220/ae739526/attachment.html>