@@ -2100,24 +2100,6 @@ Instruction *InstCombinerImpl::foldSelectExtConst(SelectInst &Sel) {
2100
2100
return CastInst::Create (Instruction::CastOps (ExtOpcode), NewSel, SelType);
2101
2101
}
2102
2102
2103
- // If one arm of the select is the extend of the condition, replace that arm
2104
- // with the extension of the appropriate known bool value.
2105
- if (Cond == X) {
2106
- if (ExtInst == Sel.getTrueValue ()) {
2107
- // select X, (sext X), C --> select X, -1, C
2108
- // select X, (zext X), C --> select X, 1, C
2109
- Constant *One = ConstantInt::getTrue (SmallType);
2110
- Value *AllOnesOrOne =
2111
- Builder.CreateCast ((Instruction::CastOps)ExtOpcode, One, SelType);
2112
- return SelectInst::Create (Cond, AllOnesOrOne, C, " " , nullptr , &Sel);
2113
- } else {
2114
- // select X, C, (sext X) --> select X, C, 0
2115
- // select X, C, (zext X) --> select X, C, 0
2116
- Constant *Zero = ConstantInt::getNullValue (SelType);
2117
- return SelectInst::Create (Cond, C, Zero, " " , nullptr , &Sel);
2118
- }
2119
- }
2120
-
2121
2103
return nullptr ;
2122
2104
}
2123
2105
0 commit comments