[all-commits] [llvm/llvm-project] ed1cb0: [IRBuilder] Add IsInBounds parameter to CreateGEP()

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri May 13 05:31:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ed1cb01baf1727ce2eb9c58deafe1a92d6fc65b7
      https://github.com/llvm/llvm-project/commit/ed1cb01baf1727ce2eb9c58deafe1a92d6fc65b7
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-05-13 (Fri, 13 May 2022)

  Changed paths:
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Scalar/SROA.cpp
    M llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/InstCombine/gep-combine-loop-invariant.ll

  Log Message:
  -----------
  [IRBuilder] Add IsInBounds parameter to CreateGEP()

We commonly want to create either an inbounds or non-inbounds GEP
based on a boolean value, e.g. when preserving inbounds from
existing GEPs. Directly accept such a boolean in the API, rather
than requiring a ternary between CreateGEP and CreateInBoundsGEP.

This change is not entirely NFC, because we now preserve an
inbounds flag in a constant expression edge-case in InstCombine.




More information about the All-commits mailing list