MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / tryFoldSelectConstCondition

Function tryFoldSelectConstCondition

lib/Dialect/CudaTile/IR/CudaTile.cpp:5202–5210  ·  view source on GitHub ↗

2) select true, x, y => x select false, x, y => y

Source from the content-addressed store, hash-verified

5200// 2) select true, x, y => x
5201// select false, x, y => y
5202static 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

Callers

nothing calls this directly

Calls 2

isConstantTrueValFunction · 0.85
isConstantFalseValFunction · 0.85

Tested by

no test coverage detected