Mirror of official llvm git repository located at http://llvm.org/git/llvm. Updated every five minutes.
Go to file
Jakob Stoklund Olesen 58e9ee85fd Teach SimplifyCFG about magic pointer constants.
Weird code sometimes uses pointer constants other than null. This patch
teaches SimplifyCFG to build switch instructions in those cases.

Code like this:

void f(const char *x) {
  if (!x)
    puts("null");
  else if ((uintptr_t)x == 1)
    puts("one");
  else if (x == (char*)2 || x == (char*)3)
    puts("two");
  else if ((intptr_t)x == 4)
    puts("four");
  else
    puts(x);
}

Now becomes a switch:

define void @f(i8* %x) nounwind ssp {
entry:
  %magicptr23 = ptrtoint i8* %x to i64            ; <i64> [#uses=1]
  switch i64 %magicptr23, label %if.else16 [
    i64 0, label %if.then
    i64 1, label %if.then2
    i64 2, label %if.then9
    i64 3, label %if.then9
    i64 4, label %if.then14
  ]

Note that LLVM's own DenseMap uses magic pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 22:03:18 +00:00
autoconf Reconfigure with autoconf-2.60, and fix autoconf.ac to work with that version. 2010-02-03 02:11:49 +00:00
bindings This corrects an error in the type of the Llvm.dispose_context function. 2010-01-24 00:25:09 +00:00
cmake Update CMake LibDeps 2010-01-22 18:14:14 +00:00
docs Make docs less specific about their versions, at Chris's suggestion. 2010-02-03 18:49:55 +00:00
examples Repository access test commit 2010-02-03 12:00:02 +00:00
include Teach SimplifyCFG about magic pointer constants. 2010-02-05 22:03:18 +00:00
lib Teach SimplifyCFG about magic pointer constants. 2010-02-05 22:03:18 +00:00
projects Fix autoconf llvm srcdir location for generic projects. 2010-01-25 04:10:28 +00:00
runtime remove the random sampling framework, which is not maintained anymore. 2010-01-02 20:07:03 +00:00
test Teach SimplifyCFG about magic pointer constants. 2010-02-05 22:03:18 +00:00
tools Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp. 2010-02-05 16:19:36 +00:00
unittests Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits 2010-02-03 03:42:44 +00:00
utils Make lit's gtest support honor config.environment. 2010-02-05 18:09:19 +00:00
website
Xcode Remove the IA-64 backend. 2009-07-24 00:30:09 +00:00
build-for-llvm-top.sh Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
CMakeLists.txt CMake: Add MCParser directory. 2010-01-22 02:04:33 +00:00
configure Reconfigure with autoconf-2.60, and fix autoconf.ac to work with that version. 2010-02-03 02:11:49 +00:00
CREDITS.TXT Add myself to the blame list. 2009-08-20 15:20:15 +00:00
LICENSE.TXT 2010 is upon us. 2010-01-09 18:40:31 +00:00
llvm.spec.in
Makefile For 'install-clang' target, also traverse tools/clang/lib/Runtime. 2010-01-20 00:43:07 +00:00
Makefile.common Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.config.in Fix typos. Thanks to John Tytgat for noticing it! 2009-12-07 00:27:35 +00:00
Makefile.rules Added a custom TableGen backend to support the 2010-01-29 00:21:04 +00:00
ModuleInfo.txt Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
README.txt test commit. 2010-01-26 19:45:17 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.