Matthias Braun via llvm-dev
2016-Jul-28 20:49 UTC
[llvm-dev] Liveness of virtual registers
The isKill must be correct if present, but a vreg may still be killed even if the operand has no Kill flag. The isDead and isUndef flags however are required to be correct. We need further details to say anything about your problem, a LiveIntervals::dump() dump for example would be helpful to assess whether the liveness data is correct in your case. - Matthias> On Jul 28, 2016, at 1:42 PM, Krzysztof Parzyszek via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On 7/28/2016 3:37 PM, Xiaochu Liu via llvm-dev wrote: >> >> I am trying to use liveness of a variable while writing a >> machinefunction pass. But it seems that some virtual registers are not >> marked as dead while they should be (never used by anything else). I get >> those info by callings isDead or isDef function for that MachineOperand >> (vreg). Is there a way to get more accurate liveness info? > > The absence of these flags does not mean anything, but if they are present, then they must be correct. > > You can always use functions use_empty and use_nodbg_empty, both in MachineRegisterInfo. A precise liveness information is calculated by Live Interval Analysis. > > -Krzysztof > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Krzysztof Parzyszek via llvm-dev
2016-Jul-28 20:52 UTC
[llvm-dev] Liveness of virtual registers
On 7/28/2016 3:49 PM, Matthias Braun wrote:> > The isDead and isUndef flags however are required to be correct.Undef yes, but what relies on isDead being accurate (before live interval computation)? -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Matthias Braun via llvm-dev
2016-Jul-28 21:01 UTC
[llvm-dev] Liveness of virtual registers
> On Jul 28, 2016, at 1:52 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote: > > On 7/28/2016 3:49 PM, Matthias Braun wrote: >> >> The isDead and isUndef flags however are required to be correct. > > Undef yes, but what relies on isDead being accurate (before live interval computation)?I only remember Andy/Quentin making those conservative correctness claims about the kill flags but not the dead/undef flags. I am also pretty sure the RegisterPressure.cpp / -verify-misched fail on missing dead flags (although -verify-misched fails in several instances anyway at the moment...) On the other hand I just checked the MachineVerifier which indeed only checks for sonervatively correct dead flags as you say and I can't think of other places being problematic with missing dead flags. I wonder if that is by accident or by design. - Matthias