mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Revert commits r237521 and r237520.
The AArch64 LNT bot is unhappy - I've found that the problem is in SimpliftDemandedBits, but that's going to require another code review so reverting in the meantime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1154,30 +1154,18 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
}
|
||||
|
||||
// See if we can fold the select into one of our operands.
|
||||
if (SI.getType()->isIntOrIntVectorTy()) {
|
||||
if (SI.getType()->isIntegerTy()) {
|
||||
if (Instruction *FoldI = FoldSelectIntoOp(SI, TrueVal, FalseVal))
|
||||
return FoldI;
|
||||
|
||||
Value *LHS, *RHS, *LHS2, *RHS2;
|
||||
Instruction::CastOps CastOp;
|
||||
SelectPatternFlavor SPF = matchSelectPattern(&SI, LHS, RHS, &CastOp);
|
||||
SelectPatternFlavor SPF = matchSelectPattern(&SI, LHS, RHS);
|
||||
|
||||
// MAX(MAX(a, b), a) -> MAX(a, b)
|
||||
// MIN(MIN(a, b), a) -> MIN(a, b)
|
||||
// MAX(MIN(a, b), a) -> a
|
||||
// MIN(MAX(a, b), a) -> a
|
||||
if (SPF) {
|
||||
// Canonicalize so that type casts are outside select patterns.
|
||||
if (LHS->getType()->getPrimitiveSizeInBits() !=
|
||||
SI.getType()->getPrimitiveSizeInBits()) {
|
||||
CmpInst::Predicate Pred = getICmpPredicateForMinMax(SPF);
|
||||
Value *Cmp = Builder->CreateICmp(Pred, LHS, RHS);
|
||||
Value *NewSI = Builder->CreateCast(CastOp,
|
||||
Builder->CreateSelect(Cmp, LHS, RHS),
|
||||
SI.getType());
|
||||
return ReplaceInstUsesWith(SI, NewSI);
|
||||
}
|
||||
|
||||
// MAX(MAX(a, b), a) -> MAX(a, b)
|
||||
// MIN(MIN(a, b), a) -> MIN(a, b)
|
||||
// MAX(MIN(a, b), a) -> a
|
||||
// MIN(MAX(a, b), a) -> a
|
||||
if (SelectPatternFlavor SPF2 = matchSelectPattern(LHS, LHS2, RHS2))
|
||||
if (Instruction *R = FoldSPFofSPF(cast<Instruction>(LHS),SPF2,LHS2,RHS2,
|
||||
SI, SPF, RHS))
|
||||
|
Reference in New Issue
Block a user