This is an archive of the discontinued LLVM Phabricator instance.

X86InstrInfo: No need for liveness analysis in classifyLEAReg()
ClosedPublic

Authored by MatzeB on Jul 12 2016, 3:24 PM.

Details

Summary

classifyLEAReg() deals with switching operands from 32bit to 64bit in
order to use a LEA64_32 instruction (for three address code goodness).
It currently performs a liveness analysis to determine the kill/undef
flag for the newly added operand. This should not be necessary:

  • If the previous operand had a kill flag, then the 32bit part of the register gets killed, this will kill the super register as well.
  • If the previous operand had an undef flag then we didn't care what value we read, just use the same flag on the new operand. (No matter what an operand with an undef flag won't affect liveness)

This makes the code independent of the presence of kill flags because it
avoids a call to MachineBasicBlock::computeRegisterLiveness().

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 63737.Jul 12 2016, 3:24 PM
MatzeB retitled this revision from to X86InstrInfo: No need for liveness analysis in classifyLEAReg().
MatzeB updated this object.
MatzeB added reviewers: t.p.northover, ab, qcolombet.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.

I am currently doing a run of the test-suite to check for changes because of this. There is the possibility that the Src operand liveness is more or less precise than what computeRegisterLiveness() figures out.

I am currently doing a run of the test-suite to check for changes because of this. There is the possibility that the Src operand liveness is more or less precise than what computeRegisterLiveness() figures out.

> All test-suite binaries have the same md5sum with or without this patch.

qcolombet accepted this revision.Jul 19 2016, 4:45 PM
qcolombet edited edge metadata.

Hi Matthias,

LGTM.

Cheers,
-Quentin

This revision is now accepted and ready to land.Jul 19 2016, 4:45 PM
This revision was automatically updated to reflect the committed changes.