[PATCH] D65402: [Attributor][MustExec] Deduce dereferenceable and nonnull attribute using MustBeExecutedContextExplorer

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 14:42:47 PDT 2019


xbolva00 added a comment.

Hi,
my another question :)
clang -std=c99 -Ofast -DNDEBUG -S -emit-llvm -mllvm -enable-nonnull-arg-prop -mllvm -attributor-disable=false  code.c

define dso_local noalias %struct.tHashTableItem* @symbolNewCopy(%struct.tHashTableItem* nocapture readonly %symbol) local_unnamed_addr #2 {
entry:

  %call = tail call noalias i8* @malloc(i64 64) #8
  %0 = bitcast i8* %call to %struct.tHashTableItem*
  %1 = bitcast %struct.tHashTableItem* %symbol to i8*
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(64) %call, i8* nonnull align 8 dereferenceable(64) %1, i64 64, i1 false)
  %cmp = icmp eq i8* %call, null

Curently LLVM fails to propagate attributes to arguments thru bitcasts, it seems. With this patch help with this case?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65402/new/

https://reviews.llvm.org/D65402





More information about the llvm-commits mailing list