*** empty log message ***
authorChris Lattner <sabre@nondot.org>
Thu, 22 Aug 2002 22:48:32 +0000 (22:48 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 22 Aug 2002 22:48:32 +0000 (22:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3483 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/ExprTypeConvert.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/LevelRaise.cpp

index fbb992bfd283d26138f7e65bab67de72d1b3004e..a84f1d0f5e3f9feb5eb7a8126d8aab62d9afb3bc 100644 (file)
@@ -216,12 +216,6 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
 
   case Instruction::Load: {
     LoadInst *LI = cast<LoadInst>(I);
-    if (LI->hasIndices() && !AllIndicesZero(LI)) {
-      // We can't convert a load expression if it has indices... unless they are
-      // all zero.
-      return false;
-    }
-
     if (!ExpressionConvertableToType(LI->getPointerOperand(),
                                      PointerType::get(Ty), CTMap))
       return false;
@@ -403,7 +397,6 @@ Value *ConvertExpressionToType(Value *V, const Type *Ty, ValueMapCache &VMC) {
 
   case Instruction::Load: {
     LoadInst *LI = cast<LoadInst>(I);
-    assert(!LI->hasIndices() || AllIndicesZero(LI));
 
     Res = new LoadInst(Constant::getNullValue(PointerType::get(Ty)), Name);
     VMC.ExprMap[I] = Res;
@@ -666,9 +659,6 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
     if (const PointerType *PT = dyn_cast<PointerType>(Ty)) {
       LoadInst *LI = cast<LoadInst>(I);
       
-      if (LI->hasIndices() && !AllIndicesZero(LI))
-        return false;
-
       const Type *LoadedTy = PT->getElementType();
 
       // They could be loading the first element of a composite type...
@@ -691,7 +681,6 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
 
   case Instruction::Store: {
     StoreInst *SI = cast<StoreInst>(I);
-    if (SI->hasIndices()) return false;
 
     if (V == I->getOperand(0)) {
       ValueTypeCache::iterator CTMI = CTMap.find(I->getOperand(1));
index 4156199aa0f7788e1267179650eb276f9abdd352..714bf7637d7202aa5f054b5fbe84a7136ed165fb 100644 (file)
@@ -366,8 +366,8 @@ static void TraceValuesAtBBExit(BasicBlock *BB,
       if (StoreInst *SI = dyn_cast<StoreInst>(&*II)) {
         assert(valuesStoredInFunction &&
                "Should not be printing a store instruction at function exit");
-        LoadInst *LI = new LoadInst(SI->getPointerOperand(), SI->copyIndices(),
-                                  "reload."+SI->getPointerOperand()->getName());
+        LoadInst *LI = new LoadInst(SI->getPointerOperand(), "reload." +
+                                    SI->getPointerOperand()->getName());
         InsertPos = ++BB->getInstList().insert(InsertPos, LI);
         valuesStoredInFunction->push_back(LI);
       }
index b2008b08a134d05de3760b04053b13555797ea7d..327735c0586bd5159757cb129f40df97b8a44739 100644 (file)
@@ -393,8 +393,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
       if (Value *CastSrc = CI->getOperand(0)) // CSPT = CastSrcPointerType
         if (const PointerType *CSPT = dyn_cast<PointerType>(CastSrc->getType()))
           // convertable types?
-          if (Val->getType()->isLosslesslyConvertableTo(CSPT->getElementType()) &&
-              !SI->hasIndices()) {      // No subscripts yet!
+          if (Val->getType()->isLosslesslyConvertableTo(CSPT->getElementType())) {
             PRINT_PEEPHOLE3("st-src-cast:in ", Pointer, Val, SI);
 
             // Insert the new T cast instruction... stealing old T's name
@@ -433,8 +432,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
       if (Value *CastSrc = CI->getOperand(0)) // CSPT = CastSrcPointerType
         if (const PointerType *CSPT = dyn_cast<PointerType>(CastSrc->getType()))
           // convertable types?
-          if (PtrElType->isLosslesslyConvertableTo(CSPT->getElementType()) &&
-              !LI->hasIndices()) {      // No subscripts yet!
+          if (PtrElType->isLosslesslyConvertableTo(CSPT->getElementType())) {
             PRINT_PEEPHOLE2("load-src-cast:in ", Pointer, LI);
 
             // Create the new load instruction... loading the pre-casted value