Skip to content

LiveVariables improperly handles killing aliased registers #1678

@llvmbot

Description

@llvmbot
Bugzilla Link 1306
Resolution FIXED
Resolved on Mar 06, 2010 13:59
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @lattner,@sunfishcode

Extended Description

Here is the beginning of the BB dump.

entry (0x8503c80, LLVM BB @​0x8501af0, ID#0):
Live Ins: %R0 %R1
%reg1024 = ORI %R0, 0
%reg1025 = ORI %R1, 0

V4R0 is getting killed because handleLiveInRegister() is called on
all results of getAliasSet() for each of the liveins (this is in
LiveIntervals::computeIntervals() ).

handleRegisterDef() does a similar thing where calls
handlePhysicalRegisterDef() on all members of getAliasSet() returned
for the def, which also triggers this problem.


This is a pretty serious bug. LiveVariables::KillsRegister should not kill aliases that are "larger". The
correct way to fix this is to explicitly list registers that are defined, used, and killed. So your example
should look like:

entry (0x8503c80, LLVM BB @​0x8501af0, ID#0):
Live Ins: %R0 %R1
%reg1024 = ORI %R0, 0, %V4R0
%reg1025 = ORI %R1, 0, %V4R0<imp-use,kill>

KillsRegister should check for exact match rather than regsOverlap. There are probably other similar
bugs in LiveVariables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions