UndefElts = UndefElts2;
if (VWidth > InVWidth) {
- LLVM_UNREACHABLE("Unimp");
+ llvm_unreachable("Unimp");
// If there are more elements in the result than there are in the source,
// then an output element is undef if the corresponding input element is
// undef.
if (UndefElts2[OutIdx/Ratio])
UndefElts.set(OutIdx);
} else if (VWidth < InVWidth) {
- LLVM_UNREACHABLE("Unimp");
+ llvm_unreachable("Unimp");
// If there are more elements in the source than there are in the result,
// then a result element is undef if all of the corresponding input
// elements are undef.
RHS = InsertNewInstBefore(new ExtractElementInst(RHS, 0U,"tmp"), *II);
switch (II->getIntrinsicID()) {
- default: LLVM_UNREACHABLE("Case stmts out of sync!");
+ default: llvm_unreachable("Case stmts out of sync!");
case Intrinsic::x86_sse_sub_ss:
case Intrinsic::x86_sse2_sub_sd:
TmpV = InsertNewInstBefore(BinaryOperator::CreateFSub(LHS, RHS,
New = CmpInst::Create(*Context, CI->getOpcode(), CI->getPredicate(),
Op0, Op1, SO->getName()+".cmp");
else {
- LLVM_UNREACHABLE("Unknown binary instruction type!");
+ llvm_unreachable("Unknown binary instruction type!");
}
return IC->InsertNewInstBefore(New, I);
}
PN->getIncomingValue(i), C, "phitmp",
NonConstBB->getTerminator());
else
- LLVM_UNREACHABLE("Unknown binop!");
+ llvm_unreachable("Unknown binop!");
AddToWorkList(cast<Instruction>(InV));
}
case ICmpInst::ICMP_SLE: return 6; // 110
// True -> 7
default:
- LLVM_UNREACHABLE("Invalid ICmp predicate!");
+ llvm_unreachable("Invalid ICmp predicate!");
return 0;
}
}
// True -> 7
default:
// Not expecting FCMP_FALSE and FCMP_TRUE;
- LLVM_UNREACHABLE("Unexpected FCmp predicate!");
+ llvm_unreachable("Unexpected FCmp predicate!");
return 0;
}
}
static Value *getICmpValue(bool sign, unsigned code, Value *LHS, Value *RHS,
LLVMContext *Context) {
switch (code) {
- default: LLVM_UNREACHABLE("Illegal ICmp code!");
+ default: llvm_unreachable("Illegal ICmp code!");
case 0: return Context->getConstantIntFalse();
case 1:
if (sign)
static Value *getFCmpValue(bool isordered, unsigned code,
Value *LHS, Value *RHS, LLVMContext *Context) {
switch (code) {
- default: LLVM_UNREACHABLE("Illegal FCmp code!");
+ default: llvm_unreachable("Illegal FCmp code!");
case 0:
if (isordered)
return new FCmpInst(*Context, FCmpInst::FCMP_ORD, LHS, RHS);
case Instruction::And: Code = LHSCode & RHSCode; break;
case Instruction::Or: Code = LHSCode | RHSCode; break;
case Instruction::Xor: Code = LHSCode ^ RHSCode; break;
- default: LLVM_UNREACHABLE("Illegal logical opcode!"); return 0;
+ default: llvm_unreachable("Illegal logical opcode!"); return 0;
}
bool isSigned = ICmpInst::isSignedPredicate(RHSICI->getPredicate()) ||
assert(LHSCst != RHSCst && "Compares not folded above?");
switch (LHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X == 13 & X == 15) -> false
case ICmpInst::ICMP_UGT: // (X == 13 & X > 15) -> false
case ICmpInst::ICMP_SGT: // (X == 13 & X > 15) -> false
}
case ICmpInst::ICMP_NE:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_ULT:
if (LHSCst == SubOne(RHSCst, Context)) // (X != 13 & X u< 14) -> X < 13
return new ICmpInst(*Context, ICmpInst::ICMP_ULT, Val, LHSCst);
break;
case ICmpInst::ICMP_ULT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X u< 13 & X == 15) -> false
case ICmpInst::ICMP_UGT: // (X u< 13 & X u> 15) -> false
return ReplaceInstUsesWith(I, Context->getConstantIntFalse());
break;
case ICmpInst::ICMP_SLT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X s< 13 & X == 15) -> false
case ICmpInst::ICMP_SGT: // (X s< 13 & X s> 15) -> false
return ReplaceInstUsesWith(I, Context->getConstantIntFalse());
break;
case ICmpInst::ICMP_UGT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X u> 13 & X == 15) -> X == 15
case ICmpInst::ICMP_UGT: // (X u> 13 & X u> 15) -> X u> 15
return ReplaceInstUsesWith(I, RHS);
break;
case ICmpInst::ICMP_SGT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X s> 13 & X == 15) -> X == 15
case ICmpInst::ICMP_SGT: // (X s> 13 & X s> 15) -> X s> 15
return ReplaceInstUsesWith(I, RHS);
assert(LHSCst != RHSCst && "Compares not folded above?");
switch (LHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ:
if (LHSCst == SubOne(RHSCst, Context)) {
// (X == 13 | X == 14) -> X-13 <u 2
break;
case ICmpInst::ICMP_NE:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X != 13 | X == 15) -> X != 13
case ICmpInst::ICMP_UGT: // (X != 13 | X u> 15) -> X != 13
case ICmpInst::ICMP_SGT: // (X != 13 | X s> 15) -> X != 13
break;
case ICmpInst::ICMP_ULT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X u< 13 | X == 14) -> no change
break;
case ICmpInst::ICMP_UGT: // (X u< 13 | X u> 15) -> (X-13) u> 2
break;
case ICmpInst::ICMP_SLT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X s< 13 | X == 14) -> no change
break;
case ICmpInst::ICMP_SGT: // (X s< 13 | X s> 15) -> (X-13) s> 2
break;
case ICmpInst::ICMP_UGT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X u> 13 | X == 15) -> X u> 13
case ICmpInst::ICMP_UGT: // (X u> 13 | X u> 15) -> X u> 13
return ReplaceInstUsesWith(I, LHS);
break;
case ICmpInst::ICMP_SGT:
switch (RHSCC) {
- default: LLVM_UNREACHABLE("Unknown integer condition code!");
+ default: llvm_unreachable("Unknown integer condition code!");
case ICmpInst::ICMP_EQ: // (X s> 13 | X == 15) -> X > 13
case ICmpInst::ICMP_SGT: // (X s> 13 | X s> 15) -> X > 13
return ReplaceInstUsesWith(I, LHS);
ICmpInst::Predicate Pred;
switch (I.getPredicate()) {
- default: LLVM_UNREACHABLE("Unexpected predicate!");
+ default: llvm_unreachable("Unexpected predicate!");
case FCmpInst::FCMP_UEQ:
case FCmpInst::FCMP_OEQ:
Pred = ICmpInst::ICMP_EQ;
// the compare predicate and sometimes the value. RHSC is rounded towards
// zero at this point.
switch (Pred) {
- default: LLVM_UNREACHABLE("Unexpected integer comparison!");
+ default: llvm_unreachable("Unexpected integer comparison!");
case ICmpInst::ICMP_NE: // (float)int != 4.4 --> true
return ReplaceInstUsesWith(I, Context->getConstantIntTrue());
case ICmpInst::ICMP_EQ: // (float)int == 4.4 --> false
// Simplify 'fcmp pred X, X'
if (Op0 == Op1) {
switch (I.getPredicate()) {
- default: LLVM_UNREACHABLE("Unknown predicate!");
+ default: llvm_unreachable("Unknown predicate!");
case FCmpInst::FCMP_UEQ: // True if unordered or equal
case FCmpInst::FCMP_UGE: // True if unordered, greater than, or equal
case FCmpInst::FCMP_ULE: // True if unordered, less than, or equal
// icmp's with boolean values can always be turned into bitwise operations
if (Ty == Type::Int1Ty) {
switch (I.getPredicate()) {
- default: LLVM_UNREACHABLE("Invalid icmp instruction!");
+ default: llvm_unreachable("Invalid icmp instruction!");
case ICmpInst::ICMP_EQ: { // icmp eq i1 A, B -> ~(A^B)
Instruction *Xor = BinaryOperator::CreateXor(Op0, Op1, I.getName()+"tmp");
InsertNewInstBefore(Xor, I);
// Based on the range information we know about the LHS, see if we can
// simplify this comparison. For example, (x&4) < 8 is always true.
switch (I.getPredicate()) {
- default: LLVM_UNREACHABLE("Unknown icmp opcode!");
+ default: llvm_unreachable("Unknown icmp opcode!");
case ICmpInst::ICMP_EQ:
if (Op0Max.ult(Op1Min) || Op0Min.ugt(Op1Max))
return ReplaceInstUsesWith(I, Context->getConstantIntFalse());
Value *X = DivI->getOperand(0);
switch (Pred) {
- default: LLVM_UNREACHABLE("Unhandled icmp opcode!");
+ default: llvm_unreachable("Unhandled icmp opcode!");
case ICmpInst::ICMP_EQ:
if (LoOverflow && HiOverflow)
return ReplaceInstUsesWith(ICI, Context->getConstantIntFalse());
}
default:
// TODO: Can handle more cases here.
- LLVM_UNREACHABLE("Unreachable!");
+ llvm_unreachable("Unreachable!");
break;
}
default:
// All the others use floating point so we shouldn't actually
// get here because of the check above.
- LLVM_UNREACHABLE("Unknown cast type");
+ llvm_unreachable("Unknown cast type");
case Instruction::Trunc:
DoXForm = true;
break;
assert(Res->getType() == DestTy);
switch (CI.getOpcode()) {
- default: LLVM_UNREACHABLE("Unknown cast type!");
+ default: llvm_unreachable("Unknown cast type!");
case Instruction::Trunc:
// Just replace this cast with the result.
return ReplaceInstUsesWith(CI, Res);
static Constant *GetSelectFoldableConstant(Instruction *I,
LLVMContext *Context) {
switch (I->getOpcode()) {
- default: LLVM_UNREACHABLE("This cannot happen!");
+ default: llvm_unreachable("This cannot happen!");
case Instruction::Add:
case Instruction::Sub:
case Instruction::Or:
else
return BinaryOperator::Create(BO->getOpcode(), NewSI, MatchOp);
}
- LLVM_UNREACHABLE("Shouldn't get here");
+ llvm_unreachable("Shouldn't get here");
return 0;
}
NewSel->takeName(TVI);
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TVI))
return BinaryOperator::Create(BO->getOpcode(), FalseVal, NewSel);
- LLVM_UNREACHABLE("Unknown instruction!!");
+ llvm_unreachable("Unknown instruction!!");
}
}
}
NewSel->takeName(FVI);
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FVI))
return BinaryOperator::Create(BO->getOpcode(), TrueVal, NewSel);
- LLVM_UNREACHABLE("Unknown instruction!!");
+ llvm_unreachable("Unknown instruction!!");
}
}
}