Skip to content
  1. Jan 31, 2007
  2. Jan 30, 2007
    • Chris Lattner's avatar
      remove some bits that are not yet meant to land. · 2b15f2ba
      Chris Lattner authored
      llvm-svn: 33666
      2b15f2ba
    • Chris Lattner's avatar
      Symbolically evaluate constant expressions like &A[123] - &A[4].f. · 4284f646
      Chris Lattner authored
      This occurs in C++ code like:
      
      #include <iostream>
      #include <iterator>
      int a[] = { 1, 2, 3, 4, 5 };
      int main() {
        using namespace std;
        copy(a, a + sizeof(a)/sizeof(a[0]), ostream_iterator<int>(cout, "\n"));
        return 0;
      }
      
      Before we would decide the loop trip count is:
      sdiv (i32 sub (i32 ptrtoint (i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) to i32), i32 ptrtoint ([5 x i32]* @a to i32)), i32 4)
      
      Now we decide it is "5".  Amazing.
      
      This code will need to be refactored, but I'm doing that as a separate
      commit.
      
      llvm-svn: 33665
      4284f646
    • Evan Cheng's avatar
      - Fix codegen for pc relative constant (e.g. JT) in thumb mode: · 83f35170
      Evan Cheng authored
              .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
      LPCRELL0:
              add r1, pc, #PCRELV0
      This is not legal since add r1, pc, #c requires the constant be a multiple of 4.
      Do the following instead:
              .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
      LPCRELL0:
              mov r1, #PCRELV0
              add r1, pc
      
      - In thumb mode, it's not possible to use .set generate a pc relative stub
        address. The stub is ARM code which is in a different section from the thumb
        code. Load the value from a constpool instead.
      - Some asm printing clean up.
      
      llvm-svn: 33664
      83f35170
    • Reid Spencer's avatar
      For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid · 5301e7c6
      Reid Spencer authored
      confusion with external linkage types.
      
      llvm-svn: 33663
      5301e7c6
Loading