llvm-project/clang/lib
Chris Lattner 6c5abe88bf Implement rdar://7530813 - collapse multiple GEP instructions in IRgen
This avoids generating two gep's for common array operations.  Before
we would generate something like:

  %tmp = load i32* %X.addr                        ; <i32> [#uses=1]
  %arraydecay = getelementptr inbounds [100 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1]
  %arrayidx = getelementptr inbounds i32* %arraydecay, i32 %tmp ; <i32*> [#uses=1]
  %tmp1 = load i32* %arrayidx                     ; <i32> [#uses=1]

Now we generate:

  %tmp = load i32* %X.addr                        ; <i32> [#uses=1]
  %arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i32 %tmp ; <i32*> [#uses=1]
  %tmp1 = load i32* %arrayidx                     ; <i32> [#uses=1]

Less IR is better at -O0.

llvm-svn: 106966
2010-06-26 23:03:20 +00:00
..
AST Support UnresolvedLookupExpr for PCH. 2010-06-25 09:03:34 +00:00
Analysis Type Type::isRealFloatingType() that vectors are not floating-point 2010-06-22 23:07:26 +00:00
Basic Translate numbers properly. 2010-06-25 19:04:52 +00:00
Checker Allow '__extension__' to be analyzed in a lvalue context. 2010-06-26 22:40:52 +00:00
CodeGen Implement rdar://7530813 - collapse multiple GEP instructions in IRgen 2010-06-26 23:03:20 +00:00
Driver Implement support for -fwrapv, rdar://7221421 2010-06-26 21:25:03 +00:00
Frontend Implement support for -fwrapv, rdar://7221421 2010-06-26 21:25:03 +00:00
Headers Add a missing dependency to try to fix a buildbot failure. 2010-06-26 00:03:23 +00:00
Index Simplify libIndex Makefile, which doesn't need to worry about altivec support. 2010-06-08 20:57:18 +00:00
Lex Implement support for #pragma message, patch by Michael Spencer! 2010-06-26 17:11:39 +00:00
Parse Add parentheses suggested by gcc. 2010-06-23 19:34:52 +00:00
Rewrite introduce a new CharSourceRange class, and enhance the diagnostics routines 2010-06-18 22:45:06 +00:00
Runtime build: Get CLANG_VERSION from Version.inc instead of depending on VER file directly. 2010-06-25 17:33:49 +00:00
Sema Use TypeSourceInfo to help determine the SourceRange of a CXXNewExpr. This fixes several 2010-06-25 22:48:49 +00:00
CMakeLists.txt Split libAnalysis into two libraries: libAnalysis and libChecker. 2010-01-25 04:41:41 +00:00
Makefile Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile. 2010-06-08 20:34:18 +00:00