[AArch64][CodeGen] NFC refactor AArch64InstrInfo::optimizeCompareInstr to prepare...
authorEvgeny Astigeevich <evgeny.astigeevich@arm.com>
Wed, 6 Apr 2016 11:39:00 +0000 (11:39 +0000)
committerEvgeny Astigeevich <evgeny.astigeevich@arm.com>
Wed, 6 Apr 2016 11:39:00 +0000 (11:39 +0000)
commit9c24ebfa6de98e78d38318216dfc972e562a0939
treee8de1a1f4baab66bcc2d5477bb4ede6d0a2fd5b1
parent0b0da296e6de09610621467279a99eb290522a88
[AArch64][CodeGen] NFC refactor AArch64InstrInfo::optimizeCompareInstr to prepare it for fixing a bug in it

AArch64InstrInfo::optimizeCompareInstr has a bug which causes generation of incorrect code (PR#27158).
The patch refactors the function to simplify reviewing the fix of the bug.

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’.

Differential Revision: http://reviews.llvm.org/D18609

llvm-svn: 265531
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h