This is an archive of the discontinued LLVM Phabricator instance.

Remove TargetInstrInfo::canFoldMemoryOperand
ClosedPublic

Authored by RKSimon on Jul 18 2015, 2:52 PM.

Details

Summary

During a recent visual review of the x86 memory folding code I noticed that X86InstrInfo::canFoldMemoryOperand had bit-rotted somewhat compared to the actual foldMemoryOperand/foldMemoryOperandImpl implementation. I began investigating a fix when I realised that canFoldMemoryOperand is not actually used anywhere in the codebase.... All existing users instead call foldMemoryOperand directly when they wish to fold and can correctly deduce what they need from the return value. I don't see this state of affairs changing - do you?

This patch removes the canFoldMemoryOperand base function and the target implementations; only x86 had a real implementation, although AMDGPU had a preparatory stub that had never needed to be completed.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 30091.Jul 18 2015, 2:52 PM
RKSimon retitled this revision from to Remove TargetInstrInfo::canFoldMemoryOperand.
RKSimon updated this object.
RKSimon added reviewers: qcolombet, nadav, andreadb.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
bkramer accepted this revision.Jul 19 2015, 3:09 AM
bkramer added a reviewer: bkramer.
bkramer added a subscriber: bkramer.

LGTM. Nuke it!

This revision is now accepted and ready to land.Jul 19 2015, 3:09 AM
This revision was automatically updated to reflect the committed changes.