Due to the current way that we collect predicated instructions, we can't easily handle vpsel in tail predicated loops. There are a couple of issues:
- It will use the VPR as a predicate operand, but doesn't have to be instead a VPT block, which means we can assert while building up the VPT block because we don't find another VPST to being a new one.
- VPSEL still requires a VPR operand even after tail predicating, which means we can't remove it unless there is another instruction, such as vcmp, that can provide the VPR def.
The first issue should be a relatively simple fix in the logic of the LowOverheadLoops pass, whereas the second will require us to represent the 'implicit' tail predication with an explicit value.
This is a vpnot inside an VPT block? Crazy
This wasn't code-gen'd right? I don't think VPNOT of VPSEL should end up inside a VPT block at present. They are free-standing. (And VPNOT should turn the following instructions into "Else's", not "Then's".