AMDGPU/GlobalISel: Fix constant bus restriction errors for med3
Detected on targets older then gfx10 (e.g. gfx9) for constants that are too large to be inlined (constant are sgpr by default). In med3 combine it is expected that regbankselect maps all operands of min/max we try to match to vgpr. However constants are mapped to sgpr and there will be a sgpr-to-vgpr copy. Matchers look through sgpr-to-vgpr copies and return sgpr and these break constant bus restriction. Build med3 with all vgpr operands. Use existing sgpr-to-vgpr copies for matched sgprs. If there is no such copy (not expected) build one. Differential Revision: https://reviews.llvm.org/D114700
Loading
Please register or sign in to comment