There are a couple of difference between LLVM and "a regular compiler", which I'll assume to mean "gcc":
- LLVM is designed for whole-program analysis (aka link-time analysis), so it can optionally compile code to "bitcode", a format that it can re-analyse it later.
- LLVM provides a just-in-time compiler (JIT) so that it can re-analyse programs while they are running, just like the JVM does.
- LLVM is very well designed:
- its components are modular and well separated,
- it has 3 formats for its intermediate representation (textual, binary, and something else, which I can't remember), which are equivalent,
- its intermediate representation uses SSA form,
- its intermediate represenation has a type system.
As for Javascript and other dynamic languages, we're seeing a lot of interesting in LLVM from the dynamic language community, with Python and Ruby implementations trying it out. However, these are not attempting to be static compilers. They are focussed on using the JIT. In particular, the are optimizing long running executables using a "mixed mode interpreter", where they initially interpret the programs, and then compile them using LLVM at run-time. I haven't seen a javascript engine using LLVM, but there probably is one. It just won't create static executables, except in unusual circumstances, or for cut down versions of Javascript.
As for the reason for the creation of LLVM, it started as part of Vikram Adve's research group's work on life long compilation (which means JITs and link-time optimization). After his PhD, Chris Lattner moved to Apple, which is moving the project forward greatly (probably because it is BSD licenced, which has caused them problems in the past with gcc, which is GPL).