[PATCH] D74792: [SimplifyLibCalls][IRBuilder] Accept any IRBuilder in SimplifyLibCalls

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 13:51:30 PST 2020


nikic created this revision.
nikic added reviewers: nhaehnle, Meinersbur, xbolva00, spatel.
Herald added subscribers: llvm-commits, dexonsmith, hiraditya.
Herald added a project: LLVM.

This changes the SimplifyLibCalls utility to accept an IRBuilderBase, which allows us to pass through the IRBuilder used by InstCombine. This will ensure that new instructions get added to the worklist. The annotated test-case drops from 4 to 2 InstCombine iterations thanks to this.

To achieve this, I'm adding an `IRBuilderBase::OperandBundlesGuard`, which is basically the same as the existing InsertPointGuard and FastMathFlagsGuard, but for operand bundles. Also add a `setDefaultOperandBundles()` method so these can be set outside the constructor.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74792

Files:
  llvm/include/llvm/IR/IRBuilder.h
  llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/simplify-libcalls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74792.245253.patch
Type: text/x-patch
Size: 7629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200218/12e7c970/attachment.bin>


More information about the llvm-commits mailing list