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)
commit22e59748efc116532f6ddd09f02dcf42fa64f647
tree5036f1d4fc512c45a68ef4cfbe20f06330e50793
parent91805e6f5647f3270066d496aa3ee9c14b05d0d6
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.

llvm-svn: 225772
llvm/include/llvm/Target/TargetInstrInfo.h
llvm/lib/CodeGen/PeepholeOptimizer.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h