[all-commits] [llvm/llvm-project] e65dba: [IRBuilder] Produce canonical constexpr GEPs (#226...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Sep 29 07:52:19 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e65dba4fb29967ab597ca0acb4ec174c1016cd28
      https://github.com/llvm/llvm-project/commit/e65dba4fb29967ab597ca0acb4ec174c1016cd28
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M clang/test/Profile/branch-logical-mixed.cpp
    M clang/test/Profile/c-captured.c
    M clang/test/Profile/c-general.c
    M clang/test/Profile/c-ternary.c
    M clang/test/Profile/cxx-class.cpp
    M clang/test/Profile/cxx-lambda.cpp
    M clang/test/Profile/cxx-rangefor.cpp
    M clang/test/Profile/cxx-stmt-initializers.cpp
    M clang/test/Profile/cxx-templates.cpp
    M clang/test/Profile/cxx-throws.cpp
    M clang/test/Profile/objc-general.m
    M compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp
    M llvm/include/llvm/Analysis/InstSimplifyFolder.h
    M llvm/include/llvm/Analysis/TargetFolder.h
    M llvm/include/llvm/IR/ConstantFolder.h
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/include/llvm/IR/IRBuilderFolder.h
    M llvm/include/llvm/IR/NoFolder.h
    M llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-dynamic-lds-test-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-dynamic-lds-test.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-lower-all.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-multi-static-dynamic-indirect-access-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-multi-static-dynamic-indirect-access.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-multiple-blocks-return-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-multiple-blocks-return.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-non-kernel-declaration.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-indirect-access-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-indirect-access.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-lds-test-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-lds-test.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-function-param-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-function-param.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-lower-all.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-nested-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-nested.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-no-kernel-lds-id.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-O0.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-no-heap-ptr.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test-atomic-cmpxchg-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test-atomicrmw-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test-memintrinsic-asan.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test.ll
    M llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-vector-ptrs.ll
    M llvm/test/CodeGen/AMDGPU/lower-ctor-dtor-constexpr-alias.ll
    M llvm/test/CodeGen/AMDGPU/lower-ctor-dtor.ll
    M llvm/test/CodeGen/AMDGPU/lower-multiple-ctor-dtor.ll
    M llvm/test/CodeGen/DirectX/llc-vector-store-scalarize.ll
    M llvm/test/CodeGen/DirectX/scalar-load.ll
    M llvm/test/CodeGen/RISCV/riscv-promote-constant.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_load.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_mem_intrinsic.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_phi.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_store.ll
    M llvm/test/Instrumentation/DataFlowSanitizer/origin_store_threshold.ll
    M llvm/test/Instrumentation/InstrProfiling/amdgpu-contiguous-counters.ll
    M llvm/test/Instrumentation/InstrProfiling/conditional-counter-updates.ll
    M llvm/test/Instrumentation/NumericalStabilitySanitizer/basic.ll
    M llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
    M llvm/test/Transforms/CodeGenPrepare/AArch64/gather-scatter-opt-inseltpoison.ll
    M llvm/test/Transforms/CodeGenPrepare/AArch64/gather-scatter-opt.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/gather-scatter-opt-inseltpoison.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/gather-scatter-opt.ll
    M llvm/test/Transforms/LowerIFunc/ifunc-alias.ll
    M llvm/test/Transforms/LowerIFunc/ifunc-program-addrspace.ll
    M llvm/test/Transforms/LowerIFunc/lower-ifunc.ll
    M llvm/test/Transforms/LowerMatrixIntrinsics/const-gep.ll
    M llvm/test/Transforms/PGOProfile/counter_promo.ll
    M llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
    M llvm/test/Transforms/PGOProfile/counter_promo_exit_merge.ll
    M llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll
    M llvm/test/Transforms/PGOProfile/counter_promo_sampling.ll
    M llvm/test/Transforms/PGOProfile/instr_entry_bb.ll
    M llvm/test/Transforms/SROA/phi-gep.ll
    M llvm/test/tools/llvm-reduce/ifunc-alias.ll
    M llvm/test/tools/llvm-reduce/remove-ifunc-program-addrspace.ll
    M llvm/test/tools/llvm-reduce/remove-ifunc.ll
    M polly/test/CodeGen/MemAccess/codegen_constant_offset.ll
    M polly/test/ScopInfo/invariant_load_access_classes_different_base_type.ll
    M polly/test/ScopInfo/invariant_load_access_classes_different_base_type_escaping.ll

  Log Message:
  -----------
  [IRBuilder] Produce canonical constexpr GEPs (#226425)

This switches the IRBuilder to always produce canonical constexpr GEPs
in ptradd form, including in the case where ConstantFolder rather than
TargetFolder is used.

This is done in a slightly hacky way, by passing the DataLayout from the
insertion point into FoldGEP. In the future, when we start
canonicalizing the non-constant GEPs as well, we'll do the
canonicalization directly in IRBuilder and replace FoldGEP with
FoldPtrAdd. (Though it would be even better to make IRBuilder always
require a DataLayout and eliminate the ConstantFolder/TargetFolder
distinction...)



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