This is an archive of the discontinued LLVM Phabricator instance.

Regcall - Adding support for mask types
ClosedPublic

Authored by oren_ben_simhon on Nov 27 2016, 4:34 AM.

Details

Summary

Regcall calling convention passes mask types arguments in x86 GPR registers.
The review includes the changes required in order to support v32i1, v16i1 and v8i1.

Diff Detail

Repository
rL LLVM

Event Timeline

oren_ben_simhon retitled this revision from to Regcall - Adding support for mask types.
oren_ben_simhon updated this object.
oren_ben_simhon set the repository for this revision to rL LLVM.
oren_ben_simhon added a subscriber: llvm-commits.
aaboud edited edge metadata.Nov 29 2016, 6:40 AM

Please, create the patch using the following command:
svn diff --diff-cmd=diff -x -U999999

lib/Target/X86/X86ISelLowering.cpp
2103 ↗(On Diff #79353)

How about this refactoring?

if ((ValVT == MVT::v8i1 && (ValLoc == MVT::i8 || ValLoc == MVT::i32)) ||
    (ValVT == MVT::v16i1 && (ValLoc == MVT::i16 || ValLoc == MVT::i32))) {
   // Two stage lowering might be required
   // bitcast:   v8i1 -> i8 / v16i1 -> i16
   // anyextend: i8   -> i32 / i16   -> i32
   EVT TempValLoc = ValVT == MVT::v8i1 ? MVT::i8 : MVT::i16;
   SDValue ValToCopy = DAG.getBitcast(TempValLoc, ValArg);
   if (ValLoc == MVT::i32)
     ValToCopy = DAG.getNode(ISD::ANY_EXTEND, Dl, ValLoc, ValToCopy);
   return ValToCopy;
 } else if ((ValVT == MVT::v32i1 && ValLoc == MVT::i32) ||
            (ValVT == MVT::v64i1 && ValLoc == MVT::i64)) {
   // One stage lowering is required
   // bitcast:   v32i1 -> i32 / v64i1 -> i64
   return DAG.getBitcast(ValLoc, ValArg);
 } else
2461 ↗(On Diff #79353)

Run clang-format on these changes.

oren_ben_simhon marked 2 inline comments as done.Nov 30 2016, 8:16 AM
oren_ben_simhon edited edge metadata.

Implemented comments submitted until 11/29

Implemented comments submitted until 12/04.

Implemented offline comments by Amjad.

Can I commit this patch or you have additional comments?

aaboud accepted this revision.Dec 11 2016, 5:42 AM
aaboud edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 11 2016, 5:42 AM
This revision was automatically updated to reflect the committed changes.