The following code-sequence showed up in a testcase (isolated from SPEC2017) for if-conversion and vectorization when searching for the maximum in an array: addi a2, zero, 1 blt a1, a2, .LBB0_5 which can be expressed as `bge zero,a1,.LBB0_5`/`blez a1,/LBB0_5`. More generally, we want to express (a < 1) as (a <= 0). This adds the required isel-pattern and updates the testcases.
We already have this in this exact spot in the file. Is your repo out of date?
// Match X > -1, the canonical form of X >= 0, to the bgez pattern. def : Pat<(brcond (XLenVT (setgt GPR:$rs1, -1)), bb:$imm12), (BGE GPR:$rs1, X0, bb:$imm12)>;
Isn't this the blez pattern?
The "into" doesn't read right after the "as"
This code is pretty trivially unreachable. The block above jumps over it. I'm a little surprised CodeGenPrepare or UnreachableBlockElim didn't notice that. I'd prefer we make it reachable so it can't break in the future.