Page MenuHomePhabricator

IRBuilder: add CreateIntrinsicByType method
Needs ReviewPublic

Authored by nhaehnle on Aug 20 2020, 1:43 PM.

Details

Reviewers
arsenm
Flakebi
Summary

Allow creating an intrinsic call whose overload types are automatically
deduced based on the given return type and argument types.

The main point of this is to allow external users to create intrinsic
calls while maintaining compatibility if the set of overloaded arguments
changes.

Change-Id: I0f87caacab7c45bcb58774593eeebcd89751851e

Diff Detail

Unit TestsFailed

TimeTest
10 mslinux > LLVM-Unit.IR/_/IRTests::IRBuilderTest.Intrinsics
Note: Google Test filter = IRBuilderTest.Intrinsics [==========] Running 1 test from 1 test case. [----------] Global test environment set-up.
20 mswindows > LLVM-Unit.IR/_/IRTests_exe::IRBuilderTest.Intrinsics
Note: Google Test filter = IRBuilderTest.Intrinsics [==========] Running 1 test from 1 test case.
50 mswindows > LLVM.DebugInfo/X86::addr-tu-to-non-tu.ll
Script: -- : 'RUN: at line 1'; c:\ws\w64\llvm-project\premerge-checks\build\bin\llc.exe -filetype=obj -O0 -generate-type-units -split-dwarf-file=x.dwo < C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\addr-tu-to-non-tu.ll | c:\ws\w64\llvm-project\premerge-checks\build\bin\llvm-dwarfdump.exe -debug-info -debug-types - | c:\ws\w64\llvm-project\premerge-checks\build\bin\filecheck.exe --implicit-check-not=Unit --implicit-check-not=contents --implicit-check-not=declaration C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\addr-tu-to-non-tu.ll

Event Timeline

nhaehnle created this revision.Aug 20 2020, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2020, 1:43 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
nhaehnle requested review of this revision.Aug 20 2020, 1:43 PM
arsenm added inline comments.Aug 27 2020, 7:00 AM
llvm/include/llvm/IR/Intrinsics.h
90

This should probably elaborate a bit more on how this is different. I'm also not sure ByType is the right name. Maybe getDeclarationWithInferredType?

215

Comment what this is for?