cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM
Other
102 stars 15 forks source link

Compiler compatibility issue #24

Closed Commaster closed 6 years ago

Commaster commented 6 years ago

Change in fabb261 from https://github.com/cdl-saarland/rv/commit/fabb26183d01996fb5713e9105da86584edde141#diff-3330861d3ce98513e72cb245f8205bd3L140 to https://github.com/cdl-saarland/rv/commit/fabb26183d01996fb5713e9105da86584edde141#diff-2937886c4a61386b2fe398b56fc97a7dR86 made it incompatible with gcc 5 (gcc 7 works fine):

In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from %%/llvm/include/llvm/ADT/Optional.h:23,
                 from %%/llvm/include/llvm/ADT/STLExtras.h:20,
                 from %%/llvm/include/llvm/ADT/StringRef.h:13,
                 from %%/llvm/tools/rv/include/rv/resolver/resolver.h:5,
                 from %%/llvm/tools/rv/include/rv/resolver/listResolver.h:4,
                 from %%/llvm/tools/rv/src/resolver/listResolver.cpp:1:
/usr/include/c++/5/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator< <template-parameter-1-1> >::construct(_Up*, _Args&& ...) [with _Up = std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > >; _Args = {llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*}; _Tp = std::_Rb_tree_node<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >]’:
/usr/include/c++/5/bits/alloc_traits.h:530:4:   required from ‘static void std::allocator_traits<std::allocator<_Tp> >::construct(std::allocator_traits<std::allocator<_Tp> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > >; _Args = {llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*}; _Tp = std::_Rb_tree_node<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; std::allocator_traits<std::allocator<_Tp> >::allocator_type = std::allocator<std::_Rb_tree_node<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > > >]’
/usr/include/c++/5/bits/stl_tree.h:529:32:   required from ‘void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_construct_node(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type, _Args&& ...) [with _Args = {llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*}; _Key = const llvm::Function*; _Val = std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > >; _KeyOfValue = std::_Select1st<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; _Compare = std::less<const llvm::Function*>; _Alloc = std::allocator<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >*]’
/usr/include/c++/5/bits/stl_tree.h:546:21:   required from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*}; _Key = const llvm::Function*; _Val = std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > >; _KeyOfValue = std::_Select1st<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; _Compare = std::less<const llvm::Function*>; _Alloc = std::allocator<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >*]’
/usr/include/c++/5/bits/stl_tree.h:2123:33:   required from ‘std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_unique(_Args&& ...) [with _Args = {llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*}; _Key = const llvm::Function*; _Val = std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > >; _KeyOfValue = std::_Select1st<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; _Compare = std::less<const llvm::Function*>; _Alloc = std::allocator<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >]’
/usr/include/c++/5/bits/stl_map.h:559:64:   required from ‘std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::emplace(_Args&& ...) [with _Args = {llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*}; _Key = const llvm::Function*; _Tp = std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> >; _Compare = std::less<const llvm::Function*>; _Alloc = std::allocator<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree_iterator<std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > > >]’
%%/llvm/tools/rv/src/resolver/listResolver.cpp:86:84:   required from here
/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to ‘std::pair<const llvm::Function* const, std::unique_ptr<llvm::SmallVector<rv::VectorMapping, 4u> > >::pair(llvm::Function*&, llvm::SmallVector<rv::VectorMapping, 4u>*)’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
simoll commented 6 years ago

Well, feel free to make a PR. Does this solve the issue?

auto ItInserted = funcMappings.emplace(mapping.scalarFn, std::unique_ptr<VecMappingShortVec>(new VecMappingShortVec));

Commaster commented 6 years ago

Yes, this solved the issue. Thank you!