[all-commits] [llvm/llvm-project] 43d699: [IR] Look through bitcast in hasFnAttribute()

Antonio Frighetto via All-commits all-commits at lists.llvm.org
Tue Sep 21 12:57:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 43d6991c2a4cc2ac374e68c029634f2b59ffdfdf
      https://github.com/llvm/llvm-project/commit/43d6991c2a4cc2ac374e68c029634f2b59ffdfdf
  Author: Antonio Frighetto <me at antoniofrighetto.com>
  Date:   2021-09-21 (Tue, 21 Sep 2021)

  Changed paths:
    M llvm/lib/IR/Instructions.cpp
    A llvm/test/Analysis/MemorySSA/call-bitcast.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll
    M llvm/test/Transforms/Attributor/liveness.ll

  Log Message:
  -----------
  [IR] Look through bitcast in hasFnAttribute()

A logic incompleteness may lead MemorySSA to be too conservative
in its results. Specifically, when dealing with a call of kind
`call i32 bitcast (i1 (i1)* @test to i32 (i32)*)(i32 %1)`, where
the function `test` is declared with readonly attribute, the
bitcast is not looked through, obscuring function attributes. Hence,
some methods of CallBase (e.g., doesNotReadMemory) could provide
suboptimal results.

Differential Revision: https://reviews.llvm.org/D109888




More information about the All-commits mailing list