[LLVMdev] Compiling with Intel c++ 8.0

Bjørn Wennberg bjornw at hue.no
Wed Dec 8 12:38:27 PST 2004


Chris,

include/llvm/ADT/HashExtras.h
I did some more testing on this topic:
ICC complained that the last template was partially loaded and would be used
to instantiate the template<> struct hash<const char *>.
Rearranging the templates so that one for arbritraty pointers (inlined)
comes first, works excellent for icc.
E.g.:

template <class T> struct hash<T *> {
  inline size_t operator()(const T *Val) const {
    return reinterpret_cast<size_t>(Val);
  }
};

template <> struct hash<std::string> {
  size_t operator()(std::string const &str) const {
    return hash<char const *>()(str.c_str());
  }
};

include/llvm/Analysis/DataStructure/DSGraph.h
The inline function uses std::find() which is defined in <algorithm>.
<algorithm> is only included in the implementation file of
DataStructure.cpp. 
The choise was either to include <algorithm> in the headerfile (increasing
potentially overall compilation time), or defining the function in the .cpp
file. I chose the latter to be conformant with what you do.

lib/Analysis/AliasAnalysis.cpp
ICC gives me an error saying the function is already declared as extern.
However, as you suggest:
namespace llvm { 
	extern void BasicAAStub(); 
};
Works like a charm ! Thanx. (Should have thought of that....)


Sincerely

Bjornw>


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Chris Lattner
Sent: Wednesday, December 08, 2004 5:43 PM
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Compiling with Intel c++ 8.0

On Wed, 8 Dec 2004, [iso-8859-1] Bjxrn Wennberg wrote:

> I am attempting to compile the llvm distribution with the Intel 
> Compiler 8.0 on linux and I have some minor patches I would like to 
> apply. In our project we compile and run the code both on win32, 
> together with Morten Ofstad using the MS compiler, and on linux using the
intel compiler.

Great!  I'm going to leave the configury stuff to Reid, but here's some
feedback on the rest of the patches.  I've committed a bunch of them:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/021867.h
tml
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/021868.h
tml
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/021869.h
tml
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/021870.h
tml
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/021872.h
tml
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/021873.h
tml

However, could you explain why there hunks are needed?  For changes like
this, it is usually good to separate the "obvious" changes from the others
into distinct patches.  Here are the ones that would be good to have
comments added to them explaining them:

DataStructure/DSGraph.h: why is the method moved out of line?  Please add a
comment before the out-of-line body indicating why it should not be moved
back inline.

Analysis/AliasAnalysis.cpp: why don't you need the external stub?  Does it
work for you like this?

namespace llvm {
   extern void BasicAAStub();
}

include/llvm/ADT/HashExtras.h: Is pointer support already built into the
intel headers, making the hash implementation unneeded?  If so, please add a
comment to the #ifndef indicating that.

As a general comment, please keep source lines within 80 columns. 
Otherwise the patches look great, thanks a lot!

-Chris

--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list