Fix a silly mistake in r130338.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 28 Apr 2011 00:42:03 +0000 (00:42 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 28 Apr 2011 00:42:03 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130360 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/X86/fast-isel-x86-64.ll

index 211c76b2f308ce9811c8492c808a4eefaed9b05f..63e869960bf6075f13e5f999e687de190eff64af 100644 (file)
@@ -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<ConstantFP>(V)) {
-    if (CF->isZero()) {
+    if (CF->isNullValue()) {
       Reg = TargetMaterializeFloatZero(CF);
     } else {
       // Try to emit the constant directly.
index 40f90cf4023fdc7fadd89dad6baa749ecedf6119..f7bfe722b37db55b01d80928b399b0cd617876fd 100644 (file)
@@ -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
+}