[all-commits] [llvm/llvm-project] ba84cf: [BasicAA] Use nuw attribute of GEPs (#98608)

Hari Limaye via All-commits all-commits at lists.llvm.org
Tue Aug 20 03:00:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba84cfbe0ce2c697702c377b32e4dbf50dd1e114
      https://github.com/llvm/llvm-project/commit/ba84cfbe0ce2c697702c377b32e4dbf50dd1e114
  Author: Hari Limaye <hari.limaye at arm.com>
  Date:   2024-08-20 (Tue, 20 Aug 2024)

  Changed paths:
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    A llvm/test/Analysis/BasicAA/gep-nuw-alias.ll

  Log Message:
  -----------
  [BasicAA] Use nuw attribute of GEPs (#98608)

Use the nuw attribute of GEPs to prove that pointers do not alias, in
cases matching the following:

   +                +                     +
   | BaseOffset     |   +<nuw> Indices    |
   ---------------->|-------------------->|
   |-->V2Size       |                     |-------> V1Size
  LHS                                    RHS

If the difference between pointers is Offset +<nuw> Indices then we know
that the addition does not wrap the pointer index type (add nuw) and the
constant Offset is a lower bound on the distance between the pointers. We
can then prove NoAlias via Offset u>= V2Size.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list