[PATCH] D50039: [LibCalls] Added nonnull atribute to libc function args

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 23:20:34 PDT 2018


xbolva00 created this revision.
xbolva00 added a reviewer: efriedma.
Herald added a subscriber: llvm-commits.

This informs other passes that we can optimize e.g.:
int f(char *s) {

  memset(s, 0, 10);
  if (s == NULL)
          puts("hello");
  return 99;

}

to:

int f(char *s) {

  memset(s, 0, 10);    
  return 99;

}


Repository:
  rL LLVM

https://reviews.llvm.org/D50039

Files:
  lib/IR/IRBuilder.cpp
  lib/Transforms/Utils/BuildLibCalls.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50039.158174.patch
Type: text/x-patch
Size: 12947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180731/36c55326/attachment.bin>


More information about the llvm-commits mailing list