[GlobalISel] Fix infinite loop in reassociation combine
authorJay Foad <jay.foad@amd.com>
Fri, 14 Jul 2023 10:33:20 +0000 (11:33 +0100)
committerJay Foad <jay.foad@amd.com>
Sun, 16 Jul 2023 13:15:24 +0000 (14:15 +0100)
commita1a9c53ae7f13ecfec588bc17bcbb75a7c9c3c16
tree6f9aed81b7c03ac8bcd6590383ab5b5541881876
parent5708add6df24dcd7398e79ee0adfeee56962cc25
[GlobalISel] Fix infinite loop in reassociation combine

Don't reassociate (C1+C2)+Y -> C1+(C2+Y).

Fixes https://github.com/llvm/llvm-project/issues/63849

Differential Revision: https://reviews.llvm.org/D155284
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizer-combiner-reassoc.mir [new file with mode: 0644]