mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Lower llvm.isunordered(a, b) into a != a | b != b.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2a61536848
commit
d0656fc94d
@ -206,9 +206,14 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
break;
|
||||
}
|
||||
case Intrinsic::isunordered: {
|
||||
static Function *isunorderedFCache = 0;
|
||||
ReplaceCallWith("isunordered", CI, CI->op_begin()+1, CI->op_end(),
|
||||
Type::BoolTy, isunorderedFCache);
|
||||
Value *L = CI->getOperand(1);
|
||||
Value *R = CI->getOperand(2);
|
||||
|
||||
Value *LIsNan = new SetCondInst(Instruction::SetNE, L, L, "LIsNan", CI);
|
||||
Value *RIsNan = new SetCondInst(Instruction::SetNE, R, R, "RIsNan", CI);
|
||||
CI->replaceAllUsesWith(
|
||||
BinaryOperator::create(Instruction::Or, LIsNan, RIsNan,
|
||||
"isunordered", CI));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user