[clang] [llvm] Enable HasFastHalfType to prevent FP16 promotion and perform FABS/FNEG lowering (PR #189395)

Tharun V K via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 07:51:00 PDT 2026


tharunvk wrote:

TypeLegalization gets kicked in before OperationLegalization for fp16.
That's the reason clang would emit fpext/fptrunc sequences and convert fp16 to float

Also the current change generates pxor,vpxor,pand and vpand instead of xorps, andps, andps and vandps for  O0 because :
1. In O3, Execution Dependency Fix pass gets kicked in(converts integer-domain insts to fp), but not for O0
2. Also instruction selector defaults to integer based XOR instead of floating point based for v8fp16
3. And to implement that we can bitcast v8f16 to v4f32 to trick the instruction selector

Next suggestion to chose which path to take

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


More information about the llvm-commits mailing list