summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-29 23:35:33 +0000
committerChris Lattner <sabre@nondot.org>2010-11-29 23:35:33 +0000
commit7a0b4fdd143a8333453dbfa1a85af641c98b5ca4 (patch)
treeded09c97c8bbe90f8a09daa80e255232e01d5164 /lib/Transforms
parent695b2811866125cef47915915cb014afa99cd732 (diff)
downloadllvm-7a0b4fdd143a8333453dbfa1a85af641c98b5ca4.tar.gz
llvm-7a0b4fdd143a8333453dbfa1a85af641c98b5ca4.tar.bz2
llvm-7a0b4fdd143a8333453dbfa1a85af641c98b5ca4.tar.xz
prune an llvmcontext include and simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/MemCpyOptimizer.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 8aeaa9971a..087f022fe9 100644
--- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -16,7 +16,6 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Instructions.h"
-#include "llvm/LLVMContext.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/Dominators.h"
@@ -39,8 +38,6 @@ STATISTIC(NumMoveToCpy, "Number of memmoves converted to memcpy");
/// i16 0xF0F0, double 0.0 etc. If the value can't be handled with a repeated
/// byte store (e.g. i16 0x1234), return null.
static Value *isBytewiseValue(Value *V) {
- LLVMContext &Context = V->getContext();
-
// All byte-wide stores are splatable, even of arbitrary variables.
if (V->getType()->isIntegerTy(8)) return V;
@@ -48,9 +45,9 @@ static Value *isBytewiseValue(Value *V) {
// corresponding integer value is "byteable". An important case is 0.0.
if (ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
if (CFP->getType()->isFloatTy())
- V = ConstantExpr::getBitCast(CFP, Type::getInt32Ty(Context));
+ V = ConstantExpr::getBitCast(CFP, Type::getInt32Ty(V->getContext()));
if (CFP->getType()->isDoubleTy())
- V = ConstantExpr::getBitCast(CFP, Type::getInt64Ty(Context));
+ V = ConstantExpr::getBitCast(CFP, Type::getInt64Ty(V->getContext()));
// Don't handle long double formats, which have strange constraints.
}
@@ -73,7 +70,7 @@ static Value *isBytewiseValue(Value *V) {
if (Val != Val2)
return 0;
}
- return ConstantInt::get(Context, Val);
+ return ConstantInt::get(V->getContext(), Val);
}
}