Changes from Git (git http://labmaster3.local/git/llvm-project.git)


  1. [SimplifyLibCalls] Add dereferenceable bytes from known callsites (details)
  2. [NFC] Updated tests after r368657 (details)
  3. [ELF] Simplify handling of exportDynamic and isPreemptible (details)
Commit 39130314feeda2d3e0f8966c3809e9cd73ff6b22 by david.bolvansky
[SimplifyLibCalls] Add dereferenceable bytes from known callsites
Summary: int mm(char *a, char *b) {
   return memcmp(a,b,16);
Currently: define dso_local i32 @mm(i8* nocapture readonly %a, i8*
nocapture readonly %b) local_unnamed_addr #1 { entry:
%call = tail call i32 @memcmp(i8* %a, i8* %b, i64 16)
ret i32 %call
After patch: define dso_local i32 @mm(i8* nocapture readonly %a, i8*
nocapture readonly %b) local_unnamed_addr #1 { entry:
%call = tail call i32 @memcmp(i8* dereferenceable(16)  %a, i8*
dereferenceable(16)  %b, i64 16)
ret i32 %call

Reviewers: jdoerfert, efriedma
Reviewed By: jdoerfert
Subscribers: javed.absar, spatel, llvm-commits
Tags: #llvm
Differential Revision:
llvm-svn: 368657
The file was modifiedllvm/test/Transforms/InstCombine/memmove_chk-1.ll
The file was modifiedllvm/test/Transforms/InstCombine/strncpy_chk-1.ll
The file was modifiedllvm/test/Analysis/TypeBasedAliasAnalysis/memcpyopt.ll
The file was modifiedllvm/test/Transforms/InstCombine/strcpy_chk-1.ll
The file was modifiedllvm/test/Transforms/InstCombine/memcmp-constant-fold.ll
The file was modifiedllvm/test/Transforms/InstCombine/objsize.ll
The file was modifiedllvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
The file was modifiedllvm/test/Transforms/InstCombine/memchr.ll
The file was modifiedllvm/test/Transforms/InstCombine/align-addr.ll
The file was modifiedllvm/test/Transforms/InstCombine/stpcpy_chk-1.ll
The file was modifiedllvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
The file was modifiedllvm/test/Transforms/InstCombine/memcpy-to-load.ll
The file was modifiedllvm/test/Transforms/InstCombine/memcpy.ll
The file was modifiedllvm/test/Transforms/InstCombine/ARM/strcmp.ll
The file was addedllvm/test/Transforms/InstCombine/mem-deref-bytes.ll
The file was modifiedllvm/test/Transforms/InstCombine/strcmp-1.ll
The file was modifiedllvm/test/Transforms/MemCpyOpt/memcpy-to-memset-with-lifetimes.ll
The file was modifiedllvm/test/Transforms/InstCombine/memset_chk-1.ll
The file was modifiedllvm/test/Transforms/InstCombine/strcmp-memcmp.ll
The file was modifiedllvm/test/Transforms/InstCombine/memcpy-from-global.ll
The file was modifiedllvm/test/Transforms/InstCombine/sprintf-1.ll
The file was modifiedllvm/test/Transforms/InstCombine/memcpy_chk-1.ll
Commit c3012b2c26b05de4fe770ce6971162eff1aabeb7 by david.bolvansky
[NFC] Updated tests after r368657
llvm-svn: 368658
The file was modifiedclang/test/CodeGenCXX/auto-var-init.cpp
The file was modifiedclang/test/CodeGen/tbaa-struct.cpp
Commit c6cd62352cc15110c7a7389721560046a6635cde by maskray
[ELF] Simplify handling of exportDynamic and isPreemptible
In Writer::includeInDynSym(), exportDynamic is used by a Defined with
protected or default visibility, to record whether it is required to be
exported into .dynsym. It is set when any of the following conditions
1) There is an interposable symbol from a DSO (Undefined or SharedSymbol
with default visibility) 2) If -shared or --export-dynamic is specified,
any symbol in an object file/bitcode sets this property, unless
suppressed by canBeOmittedFromSymbolTable(). 3) --dynamic-list when
producing an executable
4) protected symbol from a DSO preempted by copy relocation/canonical
PLT when
--ignore-{data,function}-address-equality is specified 5) ifunc is
exported when -z ifunc-noplt is specified
Bullet points 4) and 5) are irrelevant in this patch.
Bullet 3) does not play well with 1) and 2). When -shared is specified,
exportDynamic of most symbols is true. This makes it incapable to record
--dynamic-list marked symbols. We thus have obscure:
    if (!config->shared)
     b->exportDynamic = true;
   else if (b->includeInDynsym())
     b->isPreemptible = true;
This patch adds another bit `Symbol::inDynamicList` to record 3). We can
thus simplify handleDynamicList() by unifying the DSO and
executable cases. It also allows us to simplify isPreemptible - now the
field is only used in finalizeSections() and later stages.
Reviewed By: peter.smith
Differential Revision:
llvm-svn: 368659
The file was modifiedlld/ELF/Symbols.cpp
The file was modifiedlld/ELF/SymbolTable.cpp
The file was modifiedlld/ELF/Writer.cpp
The file was modifiedlld/ELF/Symbols.h