[InstCombine] handle subobjects of constant aggregates
authorMartin Sebor <msebor@redhat.com>
Tue, 21 Jun 2022 17:31:58 +0000 (11:31 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 21 Jun 2022 17:55:14 +0000 (11:55 -0600)
commitb19194c032e7640be0a482f20491341a62e7304f
treef4c8a60c190a55178f34cd38519c19530289aa33
parent13eb5b3455fbeb959ab36974e17ba03222d6a4d0
[InstCombine] handle subobjects of constant aggregates

Remove the known limitation of the library function call folders to only
work with top-level arrays of characters (as per the TODO comment in
the code) and allows them to also fold calls involving subobjects of
constant aggregates such as member arrays.
27 files changed:
llvm/include/llvm/Analysis/ConstantFolding.h
llvm/lib/Analysis/ConstantFolding.cpp
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/CodeGen/AArch64/arm64-2012-05-07-MemcpyAlignBug.ll
llvm/test/CodeGen/ARM/constantpool-promote-ldrh.ll
llvm/test/CodeGen/BPF/remove_truncate_5.ll
llvm/test/CodeGen/BPF/rodata_2.ll
llvm/test/CodeGen/PowerPC/aix-vec-arg-spills-mir.ll
llvm/test/CodeGen/PowerPC/aix-vec-arg-spills.ll
llvm/test/DebugInfo/COFF/types-array.ll
llvm/test/Transforms/InstCombine/memchr-5.ll
llvm/test/Transforms/InstCombine/memchr-8.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/memcmp-3.ll
llvm/test/Transforms/InstCombine/memcmp-4.ll
llvm/test/Transforms/InstCombine/memcmp-constant-fold.ll
llvm/test/Transforms/InstCombine/memrchr-5.ll
llvm/test/Transforms/InstCombine/sprintf-2.ll
llvm/test/Transforms/InstCombine/str-int-3.ll
llvm/test/Transforms/InstCombine/strcmp-3.ll
llvm/test/Transforms/InstCombine/strlen-5.ll
llvm/test/Transforms/InstCombine/strlen-6.ll
llvm/test/Transforms/InstCombine/strlen-7.ll
llvm/test/Transforms/InstCombine/strlen-8.ll
llvm/test/Transforms/InstCombine/strncmp-4.ll
llvm/test/Transforms/InstCombine/wcslen-3.ll
llvm/test/Transforms/InstCombine/wcslen-6.ll [new file with mode: 0644]