aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2005-03-01 02:07:58 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2005-03-01 02:07:58 +0000
commitd0656fc94dbdbf87217812f68778963dbd6244eb (patch)
tree60bcee110835b5aeff16c351804c509d708d46f2 /lib/CodeGen/IntrinsicLowering.cpp
parent2a6153684843f76bb098e5c8c361c1e63fea5ccb (diff)
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
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index 85e8ba533f..0fe49ecedc 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -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;
}
}