[all-commits] [llvm/llvm-project] d60b74: [InstCombine] Set MadeIRChange in replaceInstUsesW...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Jan 23 09:56:48 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d60b74c28a076062259ba8a8b80a9bdd802c7497
      https://github.com/llvm/llvm-project/commit/d60b74c28a076062259ba8a8b80a9bdd802c7497
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-01-23 (Sat, 23 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h

  Log Message:
  -----------
  [InstCombine] Set MadeIRChange in replaceInstUsesWith.

Some utilities used by InstCombine, like SimplifyLibCalls, may add new
instructions and replace the uses of a call, but return nullptr because
the inserted call produces multiple results.

Previously, the replaced library calls would get removed by
InstCombine's deleter, but after
292077072ec1279d89d21873fe900061e55ef936 this may not happen, if the
willreturn attribute is missing.

As a work-around, update replaceInstUsesWith to set MadeIRChange, if it
replaces any uses. This catches the cases where it is used as replacer
by utilities used by InstCombine and seems useful in general; updating
uses will modify the IR.

This fixes an expensive-check failure when replacing
@__sinpif/@__cospifi with @__sincospif_sret.




More information about the All-commits mailing list