Commit e820755
Avoid ~mask in AVX-512 partition kernel (#965)
Summary:
Pull Request resolved: #965
D116655191 synced the `pivco_huffman` codec into `openzl/prod`, and since then any `buck build //...` in fbcode stalls indefinitely on `openzl/prod:compress [c_compile src/openzl/codecs/pivco_huffman/arch/encode_pivco_avx512.c]`. Full analysis is on that diff in the Review Assistant panel; abridged here:
- Under clang 19 at `-O3` the translation unit never finishes — I killed it at 10m28s with 2.1 GB RSS still climbing. Three `gdb` samples of the `cc1` process all land in SelectionDAG DAGCombine: `combineBitcastToBoolVector`, and `visitXOR` -> `haveNoCommonBitsSet` -> deeply recursive `computeKnownBits` on `v64i1`.
- Source bisection pins it to `partitionImpl`, which complements a `__mmask64` (`~bits`, `~bits & valid`) while also round-tripping it through `uint64_t` for `ZL_writeLE64`. A `packFlatDepth`-only variant of the same file compiles in 0.35s.
- openzl never saw this because `fbcode/openzl/PACKAGE` pins `llvm-fb: 21`, where the unmodified file compiles in 0.43s. A `//...` build reaches the target through an external dependent under `platform010-clang19-no-san`, bypassing the package pin.
Deriving the left-child mask with a second comparison instead of complementing keeps LLVM 19 out of that combine loop and costs nothing: `_MM_CMPINT_LT` is the exact complement of `_MM_CMPINT_GE` on unsigned lanes, and in the tail `~(cmpGE & valid) & valid == cmpLT & valid`. The emitted bitstream is unchanged.
Both trees are updated, since `sync_dev_to_prod.sh` mirrors dev into prod byte-for-byte.
Reviewed By: kevinjzhang
Differential Revision: D117300734
fbshipit-source-id: cc6e8213eac068842e393a92a8bfdb567e16b7701 parent 01cf35a commit e820755
1 file changed
Lines changed: 13 additions & 7 deletions
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
0 commit comments