For zero scale SMULFIX, expand into MUL which produces better code for X86.
For vector arguments, expand into MUL if SMULFIX is provided with a zero scale. Otherwise, expand into MULH[US] or [US]MUL_LOHI,
Paths
| Differential D56987
[Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments ClosedPublic Authored by leonardchan on Jan 20 2019, 3:31 PM.
Details Summary For zero scale SMULFIX, expand into MUL which produces better code for X86. For vector arguments, expand into MUL if SMULFIX is provided with a zero scale. Otherwise, expand into MULH[US] or [US]MUL_LOHI,
Diff Detail
Event Timelineleonardchan added a parent revision: D55625: [Intrinsic] Unsigned Fixed Point Multiplication Intrinsic.Jan 20 2019, 3:32 PM Comment Actions How common would it be that the scale is zero? Is that really expected in reality or just in this kind of handwritten test cases? Regardless, this patch does not introduce that much complexity so it does LGTM.
leonardchan marked 4 inline comments as done. Comment Actions
It's not as expected or important as with a non-zero scale, but it seems like a good case to cover. It's mostly just another test case to cover.
leonardchan added a child revision: D55720: [Intrinsic] Signed Fixed Point Saturation Multiplication Intrinsic.Jan 24 2019, 8:16 AM leonardchan removed a child revision: D55720: [Intrinsic] Signed Fixed Point Saturation Multiplication Intrinsic. leonardchan added a parent revision: D55720: [Intrinsic] Signed Fixed Point Saturation Multiplication Intrinsic. leonardchan retitled this revision from [Intrinsic] Expand vector SMULFIX to MUL on zero scale to [Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments.Jan 24 2019, 8:58 AM leonardchan marked an inline comment as done.
leonardchan marked an inline comment as done. This revision is now accepted and ready to land.Jan 29 2019, 12:53 AM Closed by commit rL352783: [Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments (authored by leonardchan). · Explain WhyJan 31 2019, 11:15 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 184552 llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/trunk/test/CodeGen/X86/smul_fix.ll
|