llvm-project
07118f5e - [X86] Fold zero-extended byte masks into 32-bit AND (#234796)

Commit
2 days ago
[X86] Fold zero-extended byte masks into 32-bit AND (#234796) A byte mask followed by zero-extension currently produces `andb; movzbl` in the parser loop from #56498. Select one 32-bit AND instead: its zero-extended immediate clears the upper bits as well as masking the byte. Match only one-use byte masks, and handle both ordinary and APX instructions. The tests cover byte-constant extension, shared masked values, live unmasked inputs, and narrow flag uses in 32-bit and 64-bit modes. This addresses the byte-mask example in #56498. Assisted-by: OpenAI Codex.
Author
Parents
Loading