This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Remove remapInstruction().
ClosedPublic

Authored by Whitney on Jan 23 2020, 9:03 AM.

Details

Summary

LoopUnroll can reuse the RemapInstruction() in ValueMapper, or remapInstructionsInBlocks() in CloneFunction, depending on the needs.
There is no need to have its own version in LoopUnroll.

By calling RemapInstruction() without TypeMapper or Materializer and with Flags (RF_NoModuleLevelChanges | RF_IgnoreMissingLocals), it does the same as remapInstruction(). remapInstructionsInBlocks() calls RemapInstruction() exactly as described.

Looking at the history, I cannot find any obvious reason to have its own version.

Diff Detail

Event Timeline

Whitney created this revision.Jan 23 2020, 9:03 AM
jdoerfert accepted this revision.Jan 23 2020, 11:58 AM

LGTM.

llvm/lib/Transforms/Utils/LoopUnroll.cpp
571

Nit: Usually ppl choose powers of two for the size and there seems little reason not to make it 8.

llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
315

Same as above.

This revision is now accepted and ready to land.Jan 23 2020, 11:58 AM
Whitney updated this revision to Diff 239971.Jan 23 2020, 12:04 PM

Changed SmallVector size from 6 to 8.

This revision was automatically updated to reflect the committed changes.