[llvm] [TailDuplicator] Add a limit on the size of predecessors (PR #78582)

Quentin Dian via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 06:18:34 PST 2024


DianQK wrote:

I can verify that the initial OOM case is back to normal.

Also, when the default branch is removed, the instructions have some improvements.

With the default branch:
```
Iterations:        100
Instructions:      710800
Total Cycles:      166608
Total uOps:        710800

Dispatch Width:    6
uOps Per Cycle:    4.27
IPC:               4.27
Block RThroughput: 1216.5
```

Without the default branch:
```
Iterations:        100
Instructions:      709000
Total Cycles:      158311
Total uOps:        709000

Dispatch Width:    6
uOps Per Cycle:    4.48
IPC:               4.48
Block RThroughput: 1205.0
```

Text diff?
```diff
diff --git a/output.s b/output.s
index 322d0d0..6ca97d0 100644
--- a/output.s
+++ b/output.s
@@ -1,5 +1,5 @@
 	.text
-	.file	"oom_manual.c"
+	.file	"oom_manual2.c"
 	.globl	f1                              # -- Begin function f1
 	.p2align	4, 0x90
 	.type	f1, at function
@@ -33,12805 +33,12788 @@ f1:                                     # @f1
 	movl	%eax, %ecx
 	shrl	%ecx
 	andl	$127, %ecx
-	cmpl	$126, %ecx
-	ja	.LBB0_15
-# %bb.1:
 	jmpq	*.LJTI0_0(,%rcx,8)
```

I can see many `cmpl` instructions disappearing.

https://github.com/llvm/llvm-project/pull/78582


More information about the llvm-commits mailing list