[llvm-commits] [llvm] r120347 - /llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Chris Lattner
sabre at nondot.org
Mon Nov 29 15:35:33 PST 2010
Author: lattner
Date: Mon Nov 29 17:35:33 2010
New Revision: 120347
URL: http://llvm.org/viewvc/llvm-project?rev=120347&view=rev
Log:
prune an llvmcontext include and simplify some code.
Modified:
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=120347&r1=120346&r2=120347&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Mon Nov 29 17:35:33 2010
@@ -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 @@
/// 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 @@
// 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 @@
if (Val != Val2)
return 0;
}
- return ConstantInt::get(Context, Val);
+ return ConstantInt::get(V->getContext(), Val);
}
}
More information about the llvm-commits
mailing list