Page MenuHomePhabricator

Pattern matching code for LibFunc
Needs ReviewPublic

Authored by Quolyk on Jan 14 2018, 11:16 PM.

Details

Summary

Provides m_LibFunc pattern that can be used to match LibFuncs. Implemented quite similar to m_Intrinsic pattern.

Diff Detail

Event Timeline

Quolyk created this revision.Jan 14 2018, 11:16 PM

Up. I guess it still needs to be merged as it introduces pattern matching for LibFuncs that would be quite usefull.

Do you need to check whether the call is marked nobuiltin?

Quolyk updated this revision to Diff 155831.Jul 17 2018, 2:55 AM

Check if call isNoBuiltin

Is it possible to add some unit test for this?

Is it possible to add some unit test for this?

I have not seen that this header is explicitly tested, but it can be tested througn some libFunc pattern matches, as I hope to introduce some using this

Is it possible to add some unit test for this?

I have not seen that this header is explicitly tested, but it can be tested througn some libFunc pattern matches, as I hope to introduce some using this

unittests/IR/PatternMatch.cpp

efriedma added inline comments.Jul 17 2018, 10:48 AM
include/llvm/IR/PatternMatch.h
1648

Please use TargetLibraryInfo::getLibFunc(ImmutableCallSite CS, LibFunc &F) when possible, so we can avoid scattering validity checks all over the code. (This formulation misses the call to isValidProtoForLibFunc.)