This is an archive of the discontinued LLVM Phabricator instance.

Lowering x86 adds/addus/subs/subus intrinsics (clang)
ClosedPublic

Authored by tkrupa on Mar 22 2018, 9:24 AM.

Diff Detail

Event Timeline

tkrupa created this revision.Mar 22 2018, 9:24 AM
craig.topper added inline comments.Mar 27 2018, 11:00 PM
lib/CodeGen/CGBuiltin.cpp
8304

Can we just create the constant in the extended type?

8317

ConstantInt::get should be able to splat on its own if you give it a vector type. Same with getAllOnesValue above

9419

Substraction->Subtraction

9426

Substraction->Subtraction

tkrupa marked 3 inline comments as done.Mar 29 2018, 7:19 AM
tkrupa added inline comments.
lib/CodeGen/CGBuiltin.cpp
8304

We can't - SignedMaxValue is created in non-extended type and llvm::ConstantInt::get makes an assertion that the input is of the same type. We can perform sext() on SignedMaxValue but the result will be the same.

tkrupa updated this revision to Diff 140244.Mar 29 2018, 7:19 AM
craig.topper accepted this revision.Mar 29 2018, 9:44 AM

LGTM with that one comment.

lib/CodeGen/CGBuiltin.cpp
8288

You could probably just do ResultType->getScalarSizeInBits() == 8

This revision is now accepted and ready to land.Mar 29 2018, 9:44 AM
tkrupa updated this revision to Diff 140401.Mar 30 2018, 3:11 AM
tkrupa marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.