This is an archive of the discontinued LLVM Phabricator instance.

[X86] Set isMovImm for some X86 instructions
AbandonedPublic

Authored by sanjoy on Jun 20 2016, 4:40 PM.

Details

Reviewers
qcolombet
MatzeB
Summary

This makes MI->isMoveImmediate() return true for the right instructions.
This is *not* an NFC since the PeepholeOptimizer pass uses this, and it
looks like the x86 backend runs PeepholeOptimizer (but no X86 test
breaks after this change).

Ideas on how to test this (or a justification for why this is NFC! :) )
will be appreciated.

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 61323.Jun 20 2016, 4:40 PM
sanjoy retitled this revision from to [X86] Set isMovImm for some X86 instructions.
sanjoy updated this object.
sanjoy added reviewers: MatzeB, qcolombet.
sanjoy added a subscriber: llvm-commits.
MatzeB edited edge metadata.Jun 20 2016, 6:04 PM

Glancing at the peephole optimizer code, isMoveImm is checked to figure out early whether TargetInstrInfo::FoldImmediate() will have any effect later. Seeing that X86 doesn't implement that function I would assume this patch to be pointless. (Or maybe we should implement FoldImmediate()?)

sanjoy abandoned this revision.Jun 27 2016, 11:48 AM

I didn't end up needing this.