llvm/lib/IR
Matthias Braun 708626d601 SimplifyLibCalls: Optimize wcslen
Refactor the strlen optimization code to work for both strlen and wcslen.

This especially helps with programs in the wild where people pass
L"string"s to const std::wstring& function parameters and the wstring
constructor gets inlined.

This also fixes a lingerind API problem/bug in getConstantStringInfo()
where zeroinitializers would always give you an empty string (without a
length) back regardless of the actual length of the initializer which
did not work well in the TrimAtNul==false causing the PR mentioned
below.

Note that the fixed getConstantStringInfo() needed fixes to SelectionDAG
memcpy lowering and may lead to some cases for out-of-bounds
zeroinitializer accesses not getting optimized anymore. So some code
with UB may produce out of bound memory reads now instead of just
producing zeros.

The refactoring "accidentally" fixes http://llvm.org/PR32124

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-19 22:37:09 +00:00
..
AsmWriter.cpp [IR] Allow attributes with global variables 2017-05-11 12:28:08 +00:00
AttributeImpl.h [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). 2017-05-15 21:57:41 +00:00
Attributes.cpp Fix off-by-one bug in AttributeList::addAttributes index handling 2017-05-19 22:23:47 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp Added missing break. 2017-05-19 20:31:51 +00:00
BasicBlock.cpp
CMakeLists.txt
Comdat.cpp
ConstantFold.cpp ConstantFold: Handle gep nonnull, undef as well 2017-05-08 17:37:33 +00:00
ConstantFold.h
ConstantRange.cpp [ConstantRange] Fix the early out in ConstantRange::multiply for positive numbers to really do what the comment says 2017-05-10 20:01:48 +00:00
Constants.cpp SimplifyLibCalls: Optimize wcslen 2017-05-19 22:37:09 +00:00
ConstantsContext.h [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
Core.cpp
DataLayout.cpp [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). 2017-05-05 22:30:37 +00:00
DebugInfo.cpp [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). 2017-05-05 22:30:37 +00:00
DebugInfoMetadata.cpp [codeview] Check for a DIExpression offset for local variables 2017-05-09 19:59:29 +00:00
DebugLoc.cpp Make it illegal for two Functions to point to the same DISubprogram 2017-05-09 19:47:37 +00:00
DiagnosticInfo.cpp IR: Give function GlobalValue::getRealLinkageName() a less misleading name: dropLLVMManglingEscape(). 2017-05-16 00:39:01 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp Remove line and file from DINamespace. 2017-04-28 22:25:46 +00:00
Dominators.cpp
Function.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
GCOV.cpp [gcov] Sort file info before printing it 2017-04-26 00:16:10 +00:00
Globals.cpp Add support for handling ifuncs to GlobalValue::getBaseObject 2017-05-15 18:28:29 +00:00
GVMaterializer.cpp
InlineAsm.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
Instruction.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
Instructions.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
IntrinsicInst.cpp
IRBuilder.cpp Fix vector pass-through value being unused in IRBuilder::CreateMaskedGather 2017-05-19 10:40:18 +00:00
IRPrintingPasses.cpp
LegacyPassManager.cpp [LTO] Print time-passes information at conclusion of LTO codegen 2017-05-16 09:43:21 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
LLVMContextImpl.h [APInt] Give the value union a name so we can remove assumptions on VAL being the larger member 2017-05-03 15:46:24 +00:00
Mangler.cpp
MDBuilder.cpp
Metadata.cpp [Metadata] Fix typos in comments. NFC 2017-04-27 05:48:29 +00:00
MetadataImpl.h
Module.cpp [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). 2017-05-10 23:41:30 +00:00
ModuleSummaryIndex.cpp Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI." 2017-05-04 18:03:25 +00:00
Operator.cpp
OptBisect.cpp
Pass.cpp
PassManager.cpp
PassRegistry.cpp [LegacyPassManager] Remove TargetMachine constructors 2017-05-18 17:21:13 +00:00
ProfileSummary.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). 2017-05-12 22:25:07 +00:00
TypeFinder.cpp
Use.cpp
User.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
Value.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
ValueSymbolTable.cpp
ValueTypes.cpp [MVT] add v1i1 MVT 2017-05-18 11:29:41 +00:00
Verifier.cpp Verifier: Check wchar_size module flag. 2017-05-19 22:37:01 +00:00