mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	Teach LiveInterval::isZeroLength about null SlotIndexes.
When instructions are deleted, they leave tombstone SlotIndex entries. The isZeroLength method should ignore these null indexes. This causes RABasic to sometimes spill a callee-saved register in the abi-isel.ll test, so don't run that test with -regalloc=basic. Prioritizing register allocation according to spill weight can cause more registers to be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131436 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -492,9 +492,10 @@ namespace llvm { | |||||||
|  |  | ||||||
|     /// Returns true if the live interval is zero length, i.e. no live ranges |     /// Returns true if the live interval is zero length, i.e. no live ranges | ||||||
|     /// span instructions. It doesn't pay to spill such an interval. |     /// span instructions. It doesn't pay to spill such an interval. | ||||||
|     bool isZeroLength() const { |     bool isZeroLength(SlotIndexes *Indexes) const { | ||||||
|       for (const_iterator i = begin(), e = end(); i != e; ++i) |       for (const_iterator i = begin(), e = end(); i != e; ++i) | ||||||
|         if (i->end.getPrevIndex() > i->start) |         if (Indexes->getNextNonNullIndex(i->start).getBaseIndex() < | ||||||
|  |             i->end.getBaseIndex()) | ||||||
|           return false; |           return false; | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -165,7 +165,7 @@ void VirtRegAuxInfo::CalculateWeightAndHint(LiveInterval &li) { | |||||||
|     return; |     return; | ||||||
|  |  | ||||||
|   // Mark li as unspillable if all live ranges are tiny. |   // Mark li as unspillable if all live ranges are tiny. | ||||||
|   if (li.isZeroLength()) { |   if (li.isZeroLength(LIS.getSlotIndexes())) { | ||||||
|     li.markNotSpillable(); |     li.markNotSpillable(); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -222,7 +222,7 @@ define <8 x i8> @vld3lanei8(i8* %A, <8 x i8>* %B) nounwind { | |||||||
| define <4 x i16> @vld3lanei16(i16* %A, <4 x i16>* %B) nounwind { | define <4 x i16> @vld3lanei16(i16* %A, <4 x i16>* %B) nounwind { | ||||||
| ;CHECK: vld3lanei16: | ;CHECK: vld3lanei16: | ||||||
| ;Check the (default) alignment value.  VLD3 does not support alignment. | ;Check the (default) alignment value.  VLD3 does not support alignment. | ||||||
| ;CHECK: vld3.16 {d16[1], d17[1], d18[1]}, [{{r[0-9]+}}] | ;CHECK: vld3.16 {d{{.*}}[1], d{{.*}}[1], d{{.*}}[1]}, [{{r[0-9]+}}] | ||||||
| 	%tmp0 = bitcast i16* %A to i8* | 	%tmp0 = bitcast i16* %A to i8* | ||||||
| 	%tmp1 = load <4 x i16>* %B | 	%tmp1 = load <4 x i16>* %B | ||||||
| 	%tmp2 = call %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8) | 	%tmp2 = call %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3lane.v4i16(i8* %tmp0, <4 x i16> %tmp1, <4 x i16> %tmp1, <4 x i16> %tmp1, i32 1, i32 8) | ||||||
| @@ -265,7 +265,7 @@ define <2 x float> @vld3lanef(float* %A, <2 x float>* %B) nounwind { | |||||||
| define <8 x i16> @vld3laneQi16(i16* %A, <8 x i16>* %B) nounwind { | define <8 x i16> @vld3laneQi16(i16* %A, <8 x i16>* %B) nounwind { | ||||||
| ;CHECK: vld3laneQi16: | ;CHECK: vld3laneQi16: | ||||||
| ;Check the (default) alignment value.  VLD3 does not support alignment. | ;Check the (default) alignment value.  VLD3 does not support alignment. | ||||||
| ;CHECK: vld3.16 {d16[1], d18[1], d20[1]}, [{{r[0-9]+}}] | ;CHECK: vld3.16 {d{{.*}}[1], d{{.*}}[1], d{{.*}}[1]}, [{{r[0-9]+}}] | ||||||
| 	%tmp0 = bitcast i16* %A to i8* | 	%tmp0 = bitcast i16* %A to i8* | ||||||
| 	%tmp1 = load <8 x i16>* %B | 	%tmp1 = load <8 x i16>* %B | ||||||
| 	%tmp2 = call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 8) | 	%tmp2 = call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8* %tmp0, <8 x i16> %tmp1, <8 x i16> %tmp1, <8 x i16> %tmp1, i32 1, i32 8) | ||||||
| @@ -280,7 +280,7 @@ define <8 x i16> @vld3laneQi16(i16* %A, <8 x i16>* %B) nounwind { | |||||||
| ;Check for a post-increment updating load with register increment. | ;Check for a post-increment updating load with register increment. | ||||||
| define <8 x i16> @vld3laneQi16_update(i16** %ptr, <8 x i16>* %B, i32 %inc) nounwind { | define <8 x i16> @vld3laneQi16_update(i16** %ptr, <8 x i16>* %B, i32 %inc) nounwind { | ||||||
| ;CHECK: vld3laneQi16_update: | ;CHECK: vld3laneQi16_update: | ||||||
| ;CHECK: vld3.16 {d16[1], d18[1], d20[1]}, [{{r[0-9]+}}], {{r[0-9]+}} | ;CHECK: vld3.16 {d{{.*}}[1], d{{.*}}[1], d{{.*}}[1]}, [{{r[0-9]+}}], {{r[0-9]+}} | ||||||
| 	%A = load i16** %ptr | 	%A = load i16** %ptr | ||||||
| 	%tmp0 = bitcast i16* %A to i8* | 	%tmp0 = bitcast i16* %A to i8* | ||||||
| 	%tmp1 = load <8 x i16>* %B | 	%tmp1 = load <8 x i16>* %B | ||||||
| @@ -344,7 +344,7 @@ declare %struct.__neon_float32x4x3_t @llvm.arm.neon.vld3lane.v4f32(i8*, <4 x flo | |||||||
| define <8 x i8> @vld4lanei8(i8* %A, <8 x i8>* %B) nounwind { | define <8 x i8> @vld4lanei8(i8* %A, <8 x i8>* %B) nounwind { | ||||||
| ;CHECK: vld4lanei8: | ;CHECK: vld4lanei8: | ||||||
| ;Check the alignment value.  Max for this instruction is 32 bits: | ;Check the alignment value.  Max for this instruction is 32 bits: | ||||||
| ;CHECK: vld4.8 {d16[1], d17[1], d18[1], d19[1]}, [{{r[0-9]+}}, :32] | ;CHECK: vld4.8 {d{{.*}}[1], d{{.*}}[1], d{{.*}}[1], d{{.*}}[1]}, [{{r[0-9]+}}, :32] | ||||||
| 	%tmp1 = load <8 x i8>* %B | 	%tmp1 = load <8 x i8>* %B | ||||||
| 	%tmp2 = call %struct.__neon_int8x8x4_t @llvm.arm.neon.vld4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 8) | 	%tmp2 = call %struct.__neon_int8x8x4_t @llvm.arm.neon.vld4lane.v8i8(i8* %A, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, <8 x i8> %tmp1, i32 1, i32 8) | ||||||
|         %tmp3 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 0 |         %tmp3 = extractvalue %struct.__neon_int8x8x4_t %tmp2, 0 | ||||||
|   | |||||||
| @@ -12,17 +12,6 @@ | |||||||
| ; RUN: llc < %s -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=dynamic-no-pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-DYNAMIC | ; RUN: llc < %s -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=dynamic-no-pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-DYNAMIC | ||||||
| ; RUN: llc < %s -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-PIC | ; RUN: llc < %s -asm-verbose=0 -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-PIC | ||||||
|  |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=i686-unknown-linux-gnu -march=x86 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-32-STATIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=i686-unknown-linux-gnu -march=x86 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-32-PIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=x86_64-unknown-linux-gnu -march=x86-64 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=LINUX-64-STATIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=x86_64-unknown-linux-gnu -march=x86-64 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=LINUX-64-PIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=i686-apple-darwin -march=x86 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=DARWIN-32-STATIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=i686-apple-darwin -march=x86 -relocation-model=dynamic-no-pic -code-model=small | FileCheck %s -check-prefix=DARWIN-32-DYNAMIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=i686-apple-darwin -march=x86 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=DARWIN-32-PIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=static -code-model=small | FileCheck %s -check-prefix=DARWIN-64-STATIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=dynamic-no-pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-DYNAMIC |  | ||||||
| ; RUN: llc < %s -asm-verbose=0 -regalloc=basic -join-physregs -mtriple=x86_64-apple-darwin -march=x86-64 -relocation-model=pic -code-model=small | FileCheck %s -check-prefix=DARWIN-64-PIC |  | ||||||
|  |  | ||||||
| @src = external global [131072 x i32] | @src = external global [131072 x i32] | ||||||
| @dst = external global [131072 x i32] | @dst = external global [131072 x i32] | ||||||
| @xsrc = external global [32 x i32] | @xsrc = external global [32 x i32] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user