[all-commits] [llvm/llvm-project] d77067: [ValueTracking] Add dominating condition support i...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Wed Dec 6 05:17:31 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d77067d08a3f56dc2d0e6c95bd2852c943df743a
https://github.com/llvm/llvm-project/commit/d77067d08a3f56dc2d0e6c95bd2852c943df743a
Author: Nikita Popov <npopov at redhat.com>
Date: 2023-12-06 (Wed, 06 Dec 2023)
Changed paths:
M clang/test/CodeGenCXX/RelativeVTablesABI/member-function-pointer.cpp
M clang/test/Headers/__clang_hip_math.hip
A llvm/include/llvm/Analysis/DomConditionCache.h
M llvm/include/llvm/Analysis/SimplifyQuery.h
M llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
M llvm/lib/Analysis/CMakeLists.txt
A llvm/lib/Analysis/DomConditionCache.cpp
M llvm/lib/Analysis/ValueTracking.cpp
M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
M llvm/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll
M llvm/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll
M llvm/test/Transforms/InstCombine/cast_phi.ll
M llvm/test/Transforms/InstCombine/icmp-binop.ll
M llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
M llvm/test/Transforms/InstCombine/icmp-ne-pow2.ll
M llvm/test/Transforms/InstCombine/icmp-of-or-x.ll
M llvm/test/Transforms/InstCombine/idioms.ll
M llvm/test/Transforms/InstCombine/known-non-zero.ll
M llvm/test/Transforms/InstCombine/minmax-of-xor-x.ll
M llvm/test/Transforms/InstCombine/shift.ll
M llvm/test/Transforms/InstCombine/sink_instruction.ll
M llvm/test/Transforms/InstCombine/sub-of-negatible-inseltpoison.ll
M llvm/test/Transforms/InstCombine/sub-of-negatible.ll
M llvm/test/Transforms/InstCombine/udiv-simplify.ll
M llvm/test/Transforms/LoopVectorize/AArch64/sve-vector-reverse.ll
M llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse-mask4.ll
M llvm/test/Transforms/LoopVectorize/ARM/mve-reductions.ll
M llvm/test/Transforms/LoopVectorize/X86/small-size.ll
M llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
M llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-store-accesses-with-gaps.ll
M llvm/test/Transforms/LoopVectorize/float-induction.ll
M llvm/test/Transforms/LoopVectorize/if-conversion-nest.ll
M llvm/test/Transforms/LoopVectorize/induction.ll
M llvm/test/Transforms/LoopVectorize/reduction.ll
M llvm/test/Transforms/LoopVectorize/runtime-check.ll
M llvm/test/Transforms/LoopVectorize/scalable-loop-unpredicated-body-scalar-tail.ll
M llvm/test/Transforms/PGOProfile/chr.ll
M llvm/test/Transforms/PhaseOrdering/X86/simplifycfg-late.ll
M llvm/test/Transforms/PhaseOrdering/X86/vdiv.ll
M llvm/test/Transforms/PhaseOrdering/loop-rotation-vs-common-code-hoisting.ll
M llvm/test/Transforms/SimpleLoopUnswitch/2007-08-01-LCSSA.ll
M llvm/test/Transforms/SimplifyCFG/merge-cond-stores.ll
Log Message:
-----------
[ValueTracking] Add dominating condition support in computeKnownBits() (#73662)
This adds support for using dominating conditions in computeKnownBits()
when called from InstCombine. The implementation uses a
DomConditionCache, which stores which branches may provide information
that is relevant for a given value.
DomConditionCache is similar to AssumptionCache, but does not try to do
any kind of automatic tracking. Relevant branches have to be explicitly
registered and invalidated values explicitly removed. The necessary
tracking is done inside InstCombine.
The reason why this doesn't just do exactly the same thing as
AssumptionCache is that a lot more transforms touch branches and branch
conditions than assumptions. AssumptionCache is an immutable analysis
and mostly gets away with this because only a handful of places have to
register additional assumptions (mostly as a result of cloning). This is
very much not the case for branches.
This change regresses compile-time by about ~0.2%. It also improves
stage2-O0-g builds by about ~0.2%, which indicates that this change results
in additional optimizations inside clang itself.
Fixes https://github.com/llvm/llvm-project/issues/74242.
More information about the All-commits
mailing list