[clang] [llvm] [clang][OpenCL] Defined integer / and % through scalar llvm.masked.{s,u}{div,rem} (PR #233902)

Igor Gorban via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 02:37:24 PST 2026


igorban-intel wrote:

Rebased the 9-commit stack onto `main` (`16edad83aead`) and addressed CI failures and review cleanups across the series:

- **CI & Portability**:
  - Sequenced `CreateICmpNE` before `CreateOr` in `BypassSlowDivision` and `DivRemPairs` to avoid C++ argument evaluation-order differences across host compilers.
  - Updated `PowerPC/masked-{sdiv,srem,udiv,urem}.ll` for the vector mask `freeze` added in legalization, moved target-specific `LoopVectorize` / `DivRemPairs` tests under `X86/` and `RISCV/` (and `-O2` pipeline check to `PhaseOrdering/`), and replaced deprecated `undef` tokens in tests with `poison`.
- **CodeGen, Middle End & Clang**:
  - Moved the general vector poison-mask-lane `LangRef` clarification to part 2 (`[CodeGen]`) alongside vector mask `freeze`, keeping part 1 (`[IR]`) scoped strictly to scalar overloads.
  - Made `IRTranslator` masked div/rem scalarization target-independent via `LegalizerInfo::isLegalOrCustom`, deduplicated `ValueTracking` known-bits dispatch and SLP vectorizability predicates, and removed unreachable legalization/lowering branches and duplicate backend tests.
  - Checked the promoted computation type in `-Wdivision-by-zero` under `-fdefined-int-divrem`, avoided emitting an empty `-fsanitize=` flag from the driver when all remaining checks in `-fsanitize=undefined` are disabled, added safe-constant-divisor handling in ClangIR, and updated the UBSan / UsersManual / ReleaseNotes docs.


https://github.com/llvm/llvm-project/pull/233902


More information about the cfe-commits mailing list