[all-commits] [llvm/llvm-project] b1f78b: [InstCombine] Reduce code duplication in GEP of PH...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat Mar 28 11:07:44 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b1f78baeaa1aadba8ab8e5b0ba102cec146a16fd
      https://github.com/llvm/llvm-project/commit/b1f78baeaa1aadba8ab8e5b0ba102cec146a16fd
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-03-28 (Sat, 28 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

  Log Message:
  -----------
  [InstCombine] Reduce code duplication in GEP of PHI transform; NFC

The `NewGEP->setOperand(DI, NewPN)` call was duplicated, and the
insertion of NewGEP is the same in both if/else, so we can extract it.


  Commit: 30d712103faa8c78e8b1dbc9cc6c9b831bb20e4c
      https://github.com/llvm/llvm-project/commit/30d712103faa8c78e8b1dbc9cc6c9b831bb20e4c
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-03-28 (Sat, 28 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/gepphigep.ll

  Log Message:
  -----------
  [InstCombine] Use replaceOperand() API in GEP transforms

To make sure that replaced operands get DCEd. This drops one
iteration from gepphigep.ll, which is still not optimal.

This was the last test case performing more than 3 iterations.

NFC-ish, only worklist order should change.


Compare: https://github.com/llvm/llvm-project/compare/e8743c0f389d...30d712103faa


More information about the All-commits mailing list