Peephole opt needs optimizeSelect() to keep track of newly created MIs
authorMehdi Amini <mehdi.amini@apple.com>
Tue, 13 Jan 2015 07:07:13 +0000 (07:07 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Tue, 13 Jan 2015 07:07:13 +0000 (07:07 +0000)
commit24dbb798ff3003c52974cfa2e4275dfd2d35b512
tree89224f45725d1906dd694ff8faeee67fe911e074
parent65535d38426ee9972e8606fb8efab4e74c5f4157
Peephole opt needs optimizeSelect() to keep track of newly created MIs

Peephole optimizer is scanning a basic block forward. At some point it
needs to answer the question "given a pointer to an MI in the current
BB, is it located before or after the current instruction".
To perform this, it keeps a set of the MIs already seen during the scan,
if a MI is not in the set, it is assumed to be after.
It means that newly created MIs have to be inserted in the set as well.

This commit passes the set as an argument to the target-dependent
optimizeSelect() so that it can properly update the set with the
(potentially) newly created MIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225772 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/PeepholeOptimizer.cpp
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h