[GlobalISel] Make G_PTR_ADD pattern matcher non-commutative.
G_PTR_ADD takes arguments of two different types, so it probably shouldn't be considered commutative just on that basis. A recent G_PTR_ADD reassociation optimization (https://reviews.llvm.org/D109528) can emit erroneous code if the pattern matcher commutes the arguments; this can happen when the base pointer was created by G_INTTOPTR of a G_CONSTANT and the offset register is variable. This was discovered on the llvm-mos fork, but I added a failing test case that should apply to AArch64 (and more generally). Differential Revision: https://reviews.llvm.org/D114655
Loading
Please register or sign in to comment