[PATCH] D73919: [InstCombine] Use replaceOperand() in more places

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 12:55:42 PST 2020


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

This is a followup to D73803 <https://reviews.llvm.org/D73803>, which uses the replaceOperand() helper in more places.

In some cases, I have instead replaced multiple setOperand() calls with creating a new instruction (those cases where we set multiple operands, and there is nothing subtle going on with preservation of instruction flags or so). That seems to be more idiomatic nowadays. This is also what causes the test changes. Is this reasonable, or do we prefer in-place modification here?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73919

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
  llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
  llvm/test/Transforms/InstCombine/icmp-custom-dl.ll
  llvm/test/Transforms/InstCombine/icmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73919.242161.patch
Type: text/x-patch
Size: 20099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200203/495de7f8/attachment.bin>


More information about the llvm-commits mailing list