JIT: Tail-merge don't produce empty blocks#129092
Conversation
…ases like optimizeBools
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
This itself has some interesting regressions related to how the backend deals with the block layout. I see cases like this where we get weird unnecessary jumps. G_M48648_IG02: ;; offset=0x0000
vucomiss xmm0, xmm1
jp SHORT G_M48648_IG03
je SHORT G_M48648_IG08
;; size=8 bbWeight=1 PerfScore 4.00
G_M48648_IG03: ;; offset=0x0008
vucomiss xmm0, xmm0
jp SHORT G_M48648_IG04
vucomiss xmm0, xmm1
jbe SHORT G_M48648_IG07
;; size=12 bbWeight=1 PerfScore 6.00
G_M48648_IG04: ;; offset=0x0014
vmovaps xmm1, xmm0
;; size=4 bbWeight=1 PerfScore 0.25
G_M48648_IG05: ;; offset=0x0018
vmovaps xmm0, xmm1
;; size=4 bbWeight=1 PerfScore 0.25
G_M48648_IG06: ;; offset=0x001C
ret
;; size=1 bbWeight=1 PerfScore 1.00
G_M48648_IG07: ;; offset=0x001D
jmp SHORT G_M48648_IG05
;; size=2 bbWeight=0 PerfScore 0.00
G_M48648_IG08: ;; offset=0x001F
vmovd eax, xmm1
test eax, eax
jl SHORT G_M48648_IG04
jmp SHORT G_M48648_IG07
;; size=10 bbWeight=0 PerfScore 0.00 |
|
@AndyAyersMS PTAL. |
|
Do we get similar results if we swap the order of the second tail merge pass with the flow graph opts? Or is this enabling more merging? |
|
I've tried moving |
I had an other change for improving the
crossJumpVictimselection logic in tail-merge, but it had random regressions because downstream phases get confused depending on where empty blocks are. This PR stops producing empty blocks in tail-merge which fixes that.It also makes sense given how we are running directly after "optimize control flow" phase which just got rid of all empty blocks.