[PATCH] D90260: [llvm-reduce] Add reduction for aliases and special globals.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 12:44:44 PDT 2020


fhahn created this revision.
fhahn added reviewers: lebedev.ri, dblaikie, arsenm.
Herald added a subscriber: mgorny.
Herald added a project: LLVM.
fhahn requested review of this revision.
Herald added a subscriber: wdng.

This patch adds a new reduction pass that tries to remove aliases and
special globals. It runs early, as most of those likely can be removed
up-front in practice.

This substantially improves llvm-reduce for IR generated by the swift
compiler, which can generate a lot of aliases and special globals, which
lead to lots of invalid reductions.

Removing aliases and special globals together is mostly done for
convenience, because both show up in IR generated by the swift compiler.

I am not sure if it is feasible to add a test case where globals cause problems,
because I think they only cause problems on large inputs where we spend a lot
of time removing globals in llvm.used & co.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90260

Files:
  llvm/test/Reduce/remove-alias.ll
  llvm/tools/llvm-reduce/CMakeLists.txt
  llvm/tools/llvm-reduce/DeltaManager.h
  llvm/tools/llvm-reduce/deltas/ReduceAliasAndSpecialGlobals.cpp
  llvm/tools/llvm-reduce/deltas/ReduceAliasAndSpecialGlobals.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90260.301085.patch
Type: text/x-patch
Size: 5586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201027/82c6304c/attachment.bin>


More information about the llvm-commits mailing list