This is an archive of the discontinued LLVM Phabricator instance.

[X86] Lowering Mask Scalar add/sub/mul/div intrinsics to native IR (Clang part)
ClosedPublic

Authored by tkrupa on Jun 9 2018, 3:20 AM.

Details

Summary

I did the div differently because it got split to three basic blocks with
a branch condition (due to div being an expensive operation)
and couldn't be combined back.

Corresponding LLVM revision: D47978

Diff Detail

Repository
rC Clang

Event Timeline

tkrupa created this revision.Jun 9 2018, 3:20 AM
craig.topper added inline comments.Jun 9 2018, 9:23 PM
lib/CodeGen/CGBuiltin.cpp
10006

Can we just emit the and+icmp that the other operations end up with?

tkrupa added inline comments.Jun 10 2018, 7:37 AM
lib/CodeGen/CGBuiltin.cpp
10006

We can't - if select condition is a CmpInst, CodeGenPrepare::optimizeSelectInst replaces it with a branch condition in case of expensive operations such as div. That's the reason I'm handling it in CGBuiltin in the first place.

This revision is now accepted and ready to land.Jun 10 2018, 9:51 AM
This revision was automatically updated to reflect the committed changes.