Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

An empty exit block produced by LoopSimplify increases spilling #42031

Open Quuxplusone opened 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR43061
Status NEW
Importance P enhancement
Reported by Jonas Paulsson (paulsson@linux.vnet.ibm.com)
Reported on 2019-08-20 08:34:24 -0700
Last modified on 2019-08-20 08:38:47 -0700
Version trunk
Hardware PC Linux
CC llvm-bugs@lists.llvm.org, paulsson@linux.vnet.ibm.com, quentin.colombet@gmail.com, uweigand@de.ibm.com, wmi@google.com
Fixed by commit(s)
Attachments tc.mir (12097 bytes, text/plain)
tc.emptyexitblock.mir (12230 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 22400
llc input

I was experimenting with a pre-isl loop pass and found that by running the
LoopSimplify pass I saw generally more spilling. This happened also when I
turned off my optimization, so that *only* canonicalization of loop was the
difference.

I am not sure this is something worth looking into, but it looks like a
potential area improvement since an empty block after a loop (exit block) by
itself does not change the register allocation problem.

llc -mcpu=z14 ./tc.mir -o out.0.s -start-before=greedy
llc -mcpu=z14 ./tc.emptyexitblock.mir -o out.1.s -start-before=greedy

out.1.s has one more spilled interval, around the loop. The only (real)
difference between the two mir files is:

<   bb66:                                             ; preds = %bb51, %bb19
---
>   bb66.loopexit:                                    ; preds = %bb51
>     br label %bb66
>
>   bb66:                                             ; preds = %bb66.loopexit,
Quuxplusone commented 5 years ago

Attached tc.mir (12097 bytes, text/plain): llc input

Quuxplusone commented 5 years ago

Attached tc.emptyexitblock.mir (12230 bytes, text/plain): llc input