[RISCV] XTHeadMemPair: Fix invalid mempair combine for types other than i32/i64
authorManolis Tsamis <manolis.tsamis@vrull.eu>
Wed, 22 Feb 2023 18:57:01 +0000 (19:57 +0100)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Wed, 22 Feb 2023 18:57:37 +0000 (19:57 +0100)
commita6446668a339c1f596c34118b90eeb6127e5b550
tree47617ec6638f34e94e9853416d393aa28fddd2d8
parentd0d6d78bbda7cea3408ab2686f67e38b6fa52c6e
[RISCV] XTHeadMemPair: Fix invalid mempair combine for types other than i32/i64

A mistake in the control flow of performMemPairCombine resulted in paired
loads/stores for types that were not supported by the instructions (i8/i16).
These loads/stores could not match the constraints of the patterns defined
in the THead td file and the compiler would throw a 'Cannot select' error.

This is now fixed and two new test functions have been added in xtheadmempair.ll
which would previously crash the compiler. The compiler was additionally tested
with a wide range of benchmarks and no issues were observed.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D144559
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/xtheadmempair.ll