[PATCH] D45673: [x86] Fix PR37100 by teaching the EFLAGS copy lowering to rewrite uses across basic blocks in the limited cases where it is very straight forward to do so.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 15 09:29:05 PDT 2018


chandlerc created this revision.
chandlerc added reviewers: bkramer, craig.topper.
Herald added subscribers: hiraditya, mcrosier, sanjoy.

This will also be useful for other places where we do some limited
EFLAGS propagation across CFG edges and need to handle copy rewrites
afterward. I think this is rapidly approaching the maximum we can and
should be doing here. Everything else begins to require either heroic
analysis to prove how to do PHI insertion manually, or somehow managing
arbitrary PHI-ing of EFLAGS with general PHI insertion. Neither of these
seem at all promising so if those cases come up, we'll almost certainly
need to rewrite the parts of LLVM that produce those patterns.

We do now require dominator trees in order to reliably diagnose patterns
that would require PHI nodes. This is a bit unfortunate but it seems
better than the completely mysterious crash we would get otherwise.


Repository:
  rL LLVM

https://reviews.llvm.org/D45673

Files:
  llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
  llvm/test/CodeGen/X86/O0-pipeline.ll
  llvm/test/CodeGen/X86/O3-pipeline.ll
  llvm/test/CodeGen/X86/copy-eflags.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45673.142573.patch
Type: text/x-patch
Size: 16152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180415/e68f2731/attachment.bin>


More information about the llvm-commits mailing list