[PATCH] D98340: [PowerPC] Fix infinite loop in peephole CR optimization (PR49509)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 05:42:54 PST 2021


nikic created this revision.
nikic added a reviewer: PowerPC.
Herald added subscribers: shchenz, JDevlieghere, kbarton, hiraditya, nemanjai.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If we encounter a degenerate select node where both operands are the same, then we can continue negating the condition while swapping operands, resulting in an infinite loop. Avoid this by bailout out if both operands are the same.

Fixes https://bugs.llvm.org/show_bug.cgi?id=49509, encountered in stage2 rustc build.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98340

Files:
  llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
  llvm/test/CodeGen/PowerPC/pr49509.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98340.329627.patch
Type: text/x-patch
Size: 3381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210310/56d38bda/attachment.bin>


More information about the llvm-commits mailing list