[all-commits] [llvm/llvm-project] 093afe: [VPlan] Fix miscompile after PR #142433. (#147398)
James Y Knight via All-commits
all-commits at lists.llvm.org
Tue Jul 8 11:51:49 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 093afed9697d858a661d6689f35e2834bd069e49
https://github.com/llvm/llvm-project/commit/093afed9697d858a661d6689f35e2834bd069e49
Author: James Y Knight <jyknight at google.com>
Date: 2025-07-08 (Tue, 08 Jul 2025)
Changed paths:
M llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
M llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
Log Message:
-----------
[VPlan] Fix miscompile after PR #142433. (#147398)
This fixes a bug introduced by aa2402931908317f5cc19b164ef17c5a74f2ae67,
"[VPlan] Unroll VPReplicateRecipe by VF", which cloned a
VPReplicateRecipe without transferring the flags from the original.
That can cause incorrect nsw/nuw flags to be emitted on the new
instructions, which may result in miscompiles.
It turns out there were no test-cases in the repo which end up hitting
the situation where the recipe requires instruction clones to have
different flags from the underlying instruction. The existing tests
covered the flags being correct when the replacement instruction is a
vectorized version of the initial instruction, but not when it required
clones. A new test is added covering this.
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