[all-commits] [llvm/llvm-project] 20bbd8: [SimplifyCFG] Cost speculated selects with their r...
Guy David via All-commits
all-commits at lists.llvm.org
Sun Sep 27 10:41:35 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 20bbd88cf9e7be286b25c29c877c2d0564da9ecf
https://github.com/llvm/llvm-project/commit/20bbd88cf9e7be286b25c29c877c2d0564da9ecf
Author: Guy David <guyda96 at gmail.com>
Date: 2026-09-27 (Sun, 27 Sep 2026)
Changed paths:
M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
A llvm/test/Transforms/SimplifyCFG/AArch64/speculate-vector-phi-select-cost.ll
A llvm/test/Transforms/SimplifyCFG/ARM/speculate-vector-phi-select-cost.ll
A llvm/test/Transforms/SimplifyCFG/RISCV/speculate-mask-phi-select-cost.ll
A llvm/test/Transforms/SimplifyCFG/X86/speculate-mask-phi-select-cost.ll
Log Message:
-----------
[SimplifyCFG] Cost speculated selects with their real scalar condition (#217664)
`validateAndCostRequiredSelects()` priced the selects that
`speculativelyExecuteBB()` would create using
`CmpInst::makeCmpResultType(PN->getType())` as the condition type. For a
vector phi, that asks the target for the cost of a per-lane vector
select, but the select actually created uses the branch condition, which
is always a scalar `i1`.
This only changes behaviour where a target's cost model distinguishes
the two condition types. Of the targets checked, only AArch64 does.
This may worsen the compiler's output in RISC-V, X86, ARM, so no
intention to merge soon before collecting more feedback on how the
different targets should communicate this property.
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