[AArch64][GISel] Fix selection of G_CONSTANT_FOLD_BARRIER
As far as I understand - When lowering a G_CONSTANT_FOLD_BARRIER we replace the DstReg with SrcReg, and need to check that the register class is equivalent when doing so for the replacement to be legal. During lowering we could end up visiting nodes in an odd order, leaving a G_CONSTANT_FOLD_BARRIER with a known regclass for the src, but only a regbank for the dst. Providing the Regbank contains the regclass, the replacement should still be safe. This fixes an assert seen in the llvm-test-suite when lowering hoisted constants, relaxing canReplaceReg to account for the case when the regbank covers the regclass, so it is better able to handle differences in visiting order. Differential Revision: https://reviews.llvm.org/D157202
Loading
Please sign in to comment