Page MenuHomePhabricator

[X86] Avoid creating a critical edge during cmov expansion
Needs ReviewPublic

Authored by craig.topper on Nov 5 2018, 12:01 PM.

Details

Summary

As suggested in PR39534, this patch teaches cmov expansion to avoid creating a critical edge by creating a diamond control flow rather than a triangle control flow.

Unfortunately, it doesn't seem to fix the problem reported in that PR. But maybe it gets us closer to being able to fix it?

Diff Detail

Event Timeline

craig.topper created this revision.Nov 5 2018, 12:01 PM
craig.topper added inline comments.Nov 5 2018, 12:02 PM
test/CodeGen/X86/2011-12-26-extractelement-duplicate-load.ll
13

This looks worse. We gained an instruction. There are similar instances of this in other tests.

Unfortunately, it doesn't seem to fix the problem reported in that PR. But maybe it gets us closer to being able to fix it?

This is surprising to me. I didn't do anything else in my experiments in http://llvm.org/PR39534 except forcing phi elimination to split more...

test/CodeGen/X86/atomic32.ll
325

on the bright side it saves a spill here... Probably needs some benchmarking to see whether it is a net progression or regression...

It looks like "Early Tail Duplication" may have thwarted by change for the PR.