[SROA] Use the original load name with the SROA-prefixed IRB rather than
authorChandler Carruth <chandlerc@gmail.com>
Tue, 25 Feb 2014 11:21:48 +0000 (11:21 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 25 Feb 2014 11:21:48 +0000 (11:21 +0000)
just "load". This helps avoid pointless de-duping with order-sensitive
numbers as we already have unique names from the original load. It also
makes the resulting IR quite a bit easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202140 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SROA.cpp

index 33f7e1582ca60892db7f0f6654cdb1777d9616c0..298e9af032602f25b3fb67c605bb0f8c86cc9f5e 100644 (file)
@@ -2164,13 +2164,13 @@ private:
     } else if (NewBeginOffset == NewAllocaBeginOffset &&
                canConvertValue(DL, NewAllocaTy, LI.getType())) {
       V = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
-                                LI.isVolatile(), "load");
+                                LI.isVolatile(), LI.getName());
     } else {
       Type *LTy = TargetTy->getPointerTo();
       V = IRB.CreateAlignedLoad(
           getAdjustedAllocaPtr(IRB, NewBeginOffset, LTy),
           getOffsetTypeAlign(TargetTy, NewBeginOffset - NewAllocaBeginOffset),
-          LI.isVolatile(), "load");
+          LI.isVolatile(), LI.getName());
       IsPtrAdjusted = true;
     }
     V = convertValue(DL, IRB, V, TargetTy);