[llvm-commits] [llvm] r160305 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/2012-07-16-fp2ui-i1.ll

Nadav Rotem nadav.rotem at intel.com
Mon Jul 16 11:34:53 PDT 2012


Author: nadav
Date: Mon Jul 16 13:34:53 2012
New Revision: 160305

URL: http://llvm.org/viewvc/llvm-project?rev=160305&view=rev
Log:

Make ComputeDemandedBits return a deterministic result when computing an AssertZext value.
In the added testcase the constant 55 was behind an AssertZext of type i1, and ComputeDemandedBits
reported that some of the bits were both known to be one and known to be zero.

Together with Michael Kuperstein <michael.m.kuperstein at intel.com>


Added:
    llvm/trunk/test/CodeGen/X86/2012-07-16-fp2ui-i1.ll
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=160305&r1=160304&r2=160305&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jul 16 13:34:53 2012
@@ -1965,6 +1965,7 @@
     APInt InMask = APInt::getLowBitsSet(BitWidth, VT.getSizeInBits());
     ComputeMaskedBits(Op.getOperand(0), KnownZero, KnownOne, Depth+1);
     KnownZero |= (~InMask);
+    KnownOne  &= (~KnownZero);
     return;
   }
   case ISD::FGETSIGN:

Added: llvm/trunk/test/CodeGen/X86/2012-07-16-fp2ui-i1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2012-07-16-fp2ui-i1.ll?rev=160305&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2012-07-16-fp2ui-i1.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2012-07-16-fp2ui-i1.ll Mon Jul 16 13:34:53 2012
@@ -0,0 +1,12 @@
+; RUN: llc < %s -march=x86-64 -mcpu=corei7
+
+define void @autogen_SD3100() {
+BB:
+  %FC123 = fptoui float 0x40693F5D00000000 to i1
+  br i1 %FC123, label %V, label %W
+
+V:
+  ret void
+W:
+  ret void
+}





More information about the llvm-commits mailing list