This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][CodeGen] Refactor AArch64InstrInfo::optimizeCompareInstr to prepare it for fixing a bug in it
ClosedPublic

Authored by eastig on Mar 30 2016, 10:14 AM.

Details

Summary

AArch64InstrInfo::optimizeCompareInstr has a bug which causes generation of incorrect code. Details can be found here: https://llvm.org/bugs/show_bug.cgi?id=27158
The patch refactors the function to simplify reviewing the fix of the bug. It does not fix the bug. It preserves the original behaviour.
The fix of the bug will be submitted later.

  1. Function name ‘modifiesConditionCode’ is changed to ‘areCFlagsAccessedBetweenInstrs’ to reflect that the function can check modifying accesses, reading accesses or both.
  2. Function ‘AArch64InstrInfo::optimizeCompareInstr’
    • Documented the function
    • Cmp_NZCV is DeadNZCVIdx to reflect that it is an operand index of dead NZCV
    • The code for the case of substituting CmpInstr is put into separate functions the main of them is ‘substituteCmpInstr’.

Diff Detail

Repository
rL LLVM

Event Timeline

eastig updated this revision to Diff 52075.Mar 30 2016, 10:14 AM
eastig retitled this revision from to [AArch64][CodeGen] Refactor AArch64InstrInfo::optimizeCompareInstr to prepare it for fixing a bug in it.
eastig updated this object.
eastig added a reviewer: jmolloy.
eastig added a subscriber: llvm-commits.
eastig updated this object.Mar 31 2016, 3:30 AM
jmolloy accepted this revision.Apr 5 2016, 10:41 AM
jmolloy edited edge metadata.

Hi Evgeny,

This is a nice change. LGTM! Thanks!

James

This revision is now accepted and ready to land.Apr 5 2016, 10:41 AM
This revision was automatically updated to reflect the committed changes.