[all-commits] [llvm/llvm-project] 8cdecd: [IR] Add getelementptr nusw and nuw flags (#90824)

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon May 27 07:05:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8cdecd4d3aedea7bc5f27d1f69da216100cb2815
      https://github.com/llvm/llvm-project/commit/8cdecd4d3aedea7bc5f27d1f69da216100cb2815
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-05-27 (Mon, 27 May 2024)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm/AsmParser/LLToken.h
    M llvm/include/llvm/Bitcode/LLVMBitCodes.h
    M llvm/include/llvm/IR/Constants.h
    A llvm/include/llvm/IR/GEPNoWrapFlags.h
    M llvm/include/llvm/IR/Instructions.h
    M llvm/include/llvm/IR/Operator.h
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/AsmParser/LLLexer.cpp
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/ConstantFold.cpp
    M llvm/lib/IR/Constants.cpp
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/IR/Operator.cpp
    M llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
    M llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
    M llvm/lib/Transforms/Utils/FunctionComparator.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/test/Assembler/flags.ll
    M llvm/test/Transforms/InstCombine/freeze.ll
    M llvm/test/Transforms/SimplifyCFG/HoistCode.ll
    M llvm/test/tools/llvm-reduce/reduce-flags.ll
    M llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp

  Log Message:
  -----------
  [IR] Add getelementptr nusw and nuw flags (#90824)

This implements the `nusw` and `nuw` flags for `getelementptr` as
proposed at
https://discourse.llvm.org/t/rfc-add-nusw-and-nuw-flags-for-getelementptr/78672.

The three possible flags are encapsulated in the new `GEPNoWrapFlags`
class. Currently this class has a ctor from bool, interpreted as the
InBounds flag. This ctor should be removed in the future, as code gets
migrated to handle all flags.

There are a few places annotated with `TODO(gep_nowrap)`, where I've had
to touch code but opted to not infer or precisely preserve the new
flags, so as to keep this as NFC as possible and make sure any changes
of that kind get test coverage when they are made.



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