[all-commits] [llvm/llvm-project] 99cf03: [TBAA] Only clear TBAAStruct if field can be extra...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Feb 9 09:55:50 PST 2024


  Branch: refs/heads/users/fhahn/tbaa-only-clear-struct-if-field-matches
  Home:   https://github.com/llvm/llvm-project
  Commit: 99cf032dfabb21b820559bae61d2354e56336fdd
      https://github.com/llvm/llvm-project/commit/99cf032dfabb21b820559bae61d2354e56336fdd
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2024-02-09 (Fri, 09 Feb 2024)

  Changed paths:
    M llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
    M llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll

  Log Message:
  -----------
  [TBAA] Only clear TBAAStruct if field can be extracted.

Retain TBAAStruct if we fail to match the access to a single field. All
users at the moment use this when using the full size of the original
access. SROA also retains the original TBAAStruct when accessing parts
at offset 0.

Motivation for this and follow-on patches is to improve codegen for
libc++, where using memcpy limits optimizations, like vectorization for
code iteration over std::vector<std::complex<float>>:
https://godbolt.org/z/f3vqYos3c

Depends on https://github.com/llvm/llvm-project/pull/81284




More information about the All-commits mailing list