[CGP] Fix infinite loop in icmp operand swapping
authorNikita Popov <npopov@redhat.com>
Fri, 16 Jun 2023 13:47:39 +0000 (15:47 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 16 Jun 2023 13:50:12 +0000 (15:50 +0200)
commitb7bd3a734c7c08e1a703a4f23e3e854ba94a1bf2
tree612565e9a42f03173b88d415f07a1eb50734226b
parent5e73fda53ccb8c1b0fd47eba189fd742256214fb
[CGP] Fix infinite loop in icmp operand swapping

Don't swap the operands if they're the same. Fixes the issue reported
at https://reviews.llvm.org/D152541#4427017.
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/X86/icmp-swap-loop.ll [new file with mode: 0644]