[PATCH] D51028: [BranchFolder] Drop kill/dead flags if they aren't present in all merged instructions

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 02:10:45 PST 2020


uabelho marked an inline comment as done.
uabelho added inline comments.


================
Comment at: llvm/lib/CodeGen/BranchFolding.cpp:861
+        // in $r0 that actually reaches <instr1> will indeed be killed there.
+        if (!OtherMO.isKill() && !OtherMO.isUndef())
+          MO.setIsKill(false);
----------------
bjope wrote:
> Afaict this isn't consistent with the mirrored situation (if MO says "undef" and OtherMO says "killed") the result will be that "undef" is dropped, but not an addition of "killed". 
> I think the result should be the same regardless of which bb that use as a base for the merge. Shouldn't it?
> 
> Btw, is there a problem with simply clearing the killed flag unless it is set in both operands?
> (I'm not sure if an undef implies killed today. Or if it that might change in the future when the freeze stuff has been implemented. In your example above instr2 is a def, but I assume it could be a use as well, that could be undef, or maybe even a use of the same undef value as used in instr1.)
I don't know. I thought that keeping "killed" if possible is better than dropping it to keep as exact liveness information as we can, but I think it can be dropped to if we prefer that.


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

https://reviews.llvm.org/D51028





More information about the llvm-commits mailing list