[all-commits] [llvm/llvm-project] 821dc0: [TypePromotion] Drop invalid nsw from promoted tru...
Vito Kortbeek via All-commits
all-commits at lists.llvm.org
Tue Sep 15 03:36:51 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 821dc0a3b170d79597a95e17fa10c2a6959c42b2
https://github.com/llvm/llvm-project/commit/821dc0a3b170d79597a95e17fa10c2a6959c42b2
Author: Vito Kortbeek <vito.kortbeek at globalfoundries.com>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M llvm/lib/CodeGen/TypePromotion.cpp
M llvm/test/Transforms/TypePromotion/ARM/casts.ll
Log Message:
-----------
[TypePromotion] Drop invalid nsw from promoted trunc-to-i1 conditions (#223637)
Fix a miscompile introduced in #216311. TypePromotion zero-extends the
operand of a trunc to i1. When doing so, drop nsw unless nuw is also
set, as the original operand might be all ones.
Preserve nuw because it remains valid when zero-extending. Preserve nuw
nsw as well, since it implies an all-zero operand when truncating to i1.
Alive2 proofs: https://alive2.llvm.org/ce/z/GHTZXg
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