Call ConstantExpr::getSelect() to fold cases like below
select <2 x i1><i1 true, i1 false>, <2 x i8> <i8 0, i8 1>, <2 x i8> <i8 2, i8 3>
All operands are constants and the condition has mixed true and false conditions
Differential D38369
[InstSimplify] teach SimplifySelectInst() to fold more vector selects haicheng on Sep 28 2017, 9:55 AM. Authored by
Details Call ConstantExpr::getSelect() to fold cases like below select <2 x i1><i1 true, i1 false>, <2 x i8> <i8 0, i8 1>, <2 x i8> <i8 2, i8 3> All operands are constants and the condition has mixed true and false conditions
Diff Detail
Event Timeline
|
I think we should use ConstantFoldSelectInstruction() here (to be more efficient?). That's the interface for other opcodes from what I can see in other parts of the file.