[PATCH] D71375: [X86] Remove EFLAGS from live-in lists of successor MBBs in X86FlagsCopyLowering

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 15:53:36 PST 2020


jonpa added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FlagsCopyLowering.cpp:523
 
+      // After this, EFLAGS will be recreated before each use.
+      if (&UseMBB != &MBB)
----------------
craig.topper wrote:
> I don't think we can do this here. Later we check for successor blocks with livein eflags and I believe we expect to be able to get back to the original MBB that started the worklist as second time if there is a loop. We don't put the initial block into the visited set until its queued as a successor. But we need the eflags livein in order to queue it.
Aha. My suggestion here did not update the live-in list for the original block, but it seems that this must then also be done at some point, which it is not...

It seems to work better then to do this when finding the successors, so that any successor with a live in EFLAGS gets it removed directly from the live-in list. This would then happen for MBB only inside a cycle when it is reached as a successor.

This seems good to me, while I still wonder if there would be any remaining cases of EFLAGS being live-in after this pass? If not, an alternative might be to just remove it from all live-in list at the end after all else.


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

https://reviews.llvm.org/D71375





More information about the llvm-commits mailing list