Disable invalid coalescer assertion.
[oota-llvm.git] / lib / CodeGen / GCStrategy.cpp
index 97826cdf2a080721b82ad4f7bedf04dc18038b28..790cb21648979beb8f2865daa683354dddbdb158 100644 (file)
@@ -271,7 +271,7 @@ bool LowerIntrinsics::PerformDefaultLowering(Function &F, GCStrategy &S) {
         case Intrinsic::gcwrite:
           if (LowerWr) {
             // Replace a write barrier with a simple store.
-            Value *St = new StoreInst(CI->getOperand(0), CI->getOperand(2), CI);
+            Value *St = new StoreInst(CI->getOperand(1), CI->getOperand(3), CI);
             CI->replaceAllUsesWith(St);
             CI->eraseFromParent();
           }
@@ -279,7 +279,7 @@ bool LowerIntrinsics::PerformDefaultLowering(Function &F, GCStrategy &S) {
         case Intrinsic::gcread:
           if (LowerRd) {
             // Replace a read barrier with a simple load.
-            Value *Ld = new LoadInst(CI->getOperand(1), "", CI);
+            Value *Ld = new LoadInst(CI->getOperand(2), "", CI);
             Ld->takeName(CI);
             CI->replaceAllUsesWith(Ld);
             CI->eraseFromParent();
@@ -290,7 +290,7 @@ bool LowerIntrinsics::PerformDefaultLowering(Function &F, GCStrategy &S) {
             // Initialize the GC root, but do not delete the intrinsic. The
             // backend needs the intrinsic to flag the stack slot.
             Roots.push_back(cast<AllocaInst>(
-                              CI->getOperand(0)->stripPointerCasts()));
+                              CI->getOperand(1)->stripPointerCasts()));
           }
           break;
         default: