[PATCH] D98600: [X86][FastISel] Fix with.overflow eflags clobber (PR49587)

Simonas Kazlauskas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 04:21:41 PDT 2021


nagisa added a comment.

My feeling is that this fix is a work-around for what is a regression llvm11->12. Here's a comment I had sitting incomplete since yesterday in bugzilla:

> Short summary of what I think is happening here:
>
> `FastISel::handlePHINodesInSuccessorBlocks` is called from `FastISel::selectInstruction` before the branch is lowered. This generates a constant 0, clobbering the flags. Later, when lowering the branch itself, we have this code:
>
> https://github.com/llvm/llvm-project/blob/fcdf7f6224610a51dc2ff47f2f1e3377329b64a7/llvm/lib/Target/X86/X86FastISel.cpp#L1758-L1769
>
> which figures it is able to fold no problem.
>
> In versions <=11 the `handlePHINodesInSuccessorBlocks` would insert the instruction for producing the constant 0 at the beginning of the MachineBB, now it only does so right before looking at the terminator.
>
> Spent some time bisecting, the regression is somewhere in the range of a57def30f539 <https://reviews.llvm.org/rGa57def30f53990aafc3f64b9b7a0f60916cc7f61>..d79642b3db1d <https://reviews.llvm.org/rGd79642b3db1d74524f41d37f78385950158787a4>.

I'm hoping to finish the bisection today and look at the reasoning for the diff/commit that introduced the regression in the first place. If its not serious, it might make more sense to simply revert it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98600/new/

https://reviews.llvm.org/D98600



More information about the llvm-commits mailing list