[llvm-commits] [llvm] r139765 - in /llvm/trunk: include/llvm/CodeGen/LiveInterval.h lib/CodeGen/RegisterCoalescer.cpp test/CodeGen/X86/2011-09-14-valcoalesce.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Sep 14 19:46:03 PDT 2011


On Sep 14, 2011, at 6:09 PM, Andrew Trick wrote:

> Author: atrick
> Date: Wed Sep 14 20:09:33 2011
> New Revision: 139765
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=139765&view=rev
> Log:
> [regcoalescing] bug fix for RegistersDefinedFromSameValue.
> 
> +    /// getVNInfoBefore - Return the VNInfo that is live up to but not
> +    /// necessarilly including Idx, or NULL. Use this to find the reaching def
> +    /// used by an instruction at this SlotIndex position.
> +    VNInfo *getVNInfoBefore(SlotIndex Idx) const {
> +      const_iterator I = FindLiveRangeContaining(Idx.getPrevIndex());
> +      return I == end() ? 0 : I->valno;
> +    }

Nice!

> --- llvm/trunk/test/CodeGen/X86/2011-09-14-valcoalesce.ll (added)
> +++ llvm/trunk/test/CodeGen/X86/2011-09-14-valcoalesce.ll Wed Sep 14 20:09:33 2011
> @@ -0,0 +1,115 @@
> +; RUN: llc < %s -march=x86
> +;
> +; Test RegistersDefinedFromSameValue. We have multiple copies of the same vreg:
> +; while.body85.i:
> +;   vreg1 = copy vreg2
> +;   vreg2 = add
> +; critical edge from land.lhs.true.i -> if.end117.i:
> +;   vreg27 = vreg2
> +; critical edge from land.lhs.true103.i -> if.end117.i:
> +;   vreg27 = vreg2
> +; if.then108.i:
> +;   vreg27 = vreg1
> +;
> +; Prior to fixing PR10920 401.bzip miscompile, the coalescer would
> +; consider vreg1 and vreg27 to be copies of the same value. It would
> +; then remove one of the critical edge copes, which cannot safely be removed.
> +

How would this test actually fail? The miscompilation didn't cause llc to crash, right?

/jakob





More information about the llvm-commits mailing list