From bd1253809bc1b2455793a64d2801db3d6317b08e Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 28 Apr 2011 00:42:03 +0000 Subject: [PATCH] Fix a silly mistake in r130338. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130360 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FastISel.cpp | 2 +- test/CodeGen/X86/fast-isel-x86-64.ll | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 211c76b2f30..63e869960bf 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -164,7 +164,7 @@ unsigned FastISel::materializeRegForValue(const Value *V, MVT VT) { Reg = getRegForValue(Constant::getNullValue(TD.getIntPtrType(V->getContext()))); } else if (const ConstantFP *CF = dyn_cast(V)) { - if (CF->isZero()) { + if (CF->isNullValue()) { Reg = TargetMaterializeFloatZero(CF); } else { // Try to emit the constant directly. diff --git a/test/CodeGen/X86/fast-isel-x86-64.ll b/test/CodeGen/X86/fast-isel-x86-64.ll index 40f90cf4023..f7bfe722b37 100644 --- a/test/CodeGen/X86/fast-isel-x86-64.ll +++ b/test/CodeGen/X86/fast-isel-x86-64.ll @@ -251,3 +251,12 @@ entry: ; CHECK: callq _test20sret } declare void @test20sret(%struct.a* sret) + +; Check that -0.0 is not materialized using pxor +define void @test21(double* %p1) { + store double -0.0, double* %p1 + ret void +; CHECK: test21: +; CHECK-NOT: pxor +; CHECK: movsd LCPI +}