2) select true, x, y => x select false, x, y => y
| 5200 | // 2) select true, x, y => x |
| 5201 | // select false, x, y => y |
| 5202 | static OpFoldResult tryFoldSelectConstCondition(SelectOp op, |
| 5203 | SelectOp::FoldAdaptor adaptor) { |
| 5204 | Value cond = op.getCond(); |
| 5205 | if (isConstantTrueVal(cond)) |
| 5206 | return op.getValIfTrue(); |
| 5207 | if (isConstantFalseVal(cond)) |
| 5208 | return op.getValIfFalse(); |
| 5209 | return {}; |
| 5210 | } |
| 5211 | |
| 5212 | // 3) Boolean identity: select c, true, false => c |
| 5213 | // (Safe because we return an existing value; the inverse case |
nothing calls this directly
no test coverage detected