[PATCH] D46414: [GlobalISel][Legalizer] More concise and faster widenScalar, NFC

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 17:35:31 PDT 2018


rtereshin created this revision.
rtereshin added reviewers: t.p.northover, ab, bogner, aditya_nandakumar, dsanders, arsenm.
Herald added subscribers: llvm-commits, kristof.beyls, rovka, wdng.
Herald added a reviewer: javed.absar.

Refactoring LegalizerHelper::widenScalar member function reducing its
size by approximately a factor of 2 and (hopefuly) making it more
straightforward and regular by introducing widenScalarSrc and
widenScalarDst helper methods.

The new widenScalar* methods mutate the instructions in place instead
of recreating them from scratch and removing the originals. The
compile time implications of this were measured on sqlite3
amalgamation, targeting AArch64 in -O0:

LegalizerHelper::widenScalar: > 25% faster
Legalizer::runOnMachineFunction: ~ 4.0 - 4.5% faster

Also adding MachineOperand::setCImm and refactoring out
MachineIRBuilder::recordInsertion methods to make the change possible.


Repository:
  rL LLVM

https://reviews.llvm.org/D46414

Files:
  include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
  include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
  include/llvm/CodeGen/MachineOperand.h
  lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
  test/CodeGen/AArch64/GlobalISel/legalize-phi.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46414.145122.patch
Type: text/x-patch
Size: 25181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180504/6287b221/attachment.bin>


More information about the llvm-commits mailing list