This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add ImmArg markings to intrinsics.
ClosedPublic

Authored by craig.topper on Feb 15 2019, 1:10 PM.

Details

Summary

Remove test cases that checked for not crashing when immediate operands were passed not an immediate. These are now considered ill-formed in IR.

This was done by manually scanning the intrinsic file for llvm_i32_ty and llvm_i8_ty which are the predominant types we use for immediates. Most of them are on vector intrinsics. I might have missed some other intrinsics.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 15 2019, 1:10 PM

Thanks, I have a hacky patch to assert in clang based on the builtin definition I'm working through. I'll see how many tests still fail with this

First set:
Missing immarg: 4 to builtin_ia32_gatherd_d
Missing immarg: 3 to
builtin_ia32_fixupimmpd512_mask
Missing immarg: 5 to builtin_ia32_fixupimmpd512_mask
Missing immarg: 1 to
builtin_ia32_vec_ext_v4hi

Update the intrinsics provided by Matt. Fix some other similar intrinsics

Missing context.

This patch makes sense - are there any warnings/assertions that check if the GCC builtin signature matches the IR intrinsic def? I had a quick look at D57825 but didn't notice anything.

Missing context.

This patch makes sense - are there any warnings/assertions that check if the GCC builtin signature matches the IR intrinsic def? I had a quick look at D57825 but didn't notice anything.

No, I just have a local hack in clang. I'm not sure where a reasonable place to put it in clang permanently is

With context

RKSimon accepted this revision.Feb 18 2019, 12:22 PM

LGTM once D57825 lands

This revision is now accepted and ready to land.Feb 18 2019, 12:22 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2019, 4:47 PM
include/llvm/IR/IntrinsicsX86.td