This is an archive of the discontinued LLVM Phabricator instance.

Peephole optimizer needs optimizeSelect() to keep track of newly created MIs
ClosedPublic

Authored by mehdi_amini on Jan 12 2015, 11:00 AM.

Details

Reviewers
qcolombet
Summary

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 patch passes the set to the target-dependent optimizeSelect() so that it can properly update the set with the (potentially) newly created MIs.

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to Peephole optimizer needs optimizeSelect() to keep track of newly created MIs.
mehdi_amini updated this object.
mehdi_amini edited the test plan for this revision. (Show Details)
mehdi_amini added a subscriber: Unknown Object (MLST).
qcolombet accepted this revision.Jan 12 2015, 1:58 PM
qcolombet added a reviewer: qcolombet.
qcolombet added a subscriber: qcolombet.

Hi Medhi,

LGTM with small nitpicks.

Thanks,
-Quentin

include/llvm/Target/TargetInstrInfo.h
609

Please add a comment for the purpose of the new argument.

lib/Target/ARM/ARMBaseInstrInfo.cpp
1890

Period at the end of a comment.

This revision is now accepted and ready to land.Jan 12 2015, 1:58 PM
mehdi_amini closed this revision.Jan 13 2015, 2:15 AM

Committed r225772