A little bit more LLVMContextification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75159 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2009-07-09 18:36:20 +00:00
parent 8b98b85c64
commit a547b4708b
2 changed files with 11 additions and 5 deletions

View File

@ -202,9 +202,13 @@ namespace llvm {
"setLength called with value of wrong type!");
setOperand(3, L);
}
void setAlignment(unsigned A) {
const Type *Int32Ty = getOperand(4)->getType();
setOperand(4, ConstantInt::get(Int32Ty, A));
void setAlignment(Constant* A) {
setOperand(4, A);
}
const Type *getAlignmentType() const {
return getOperand(4)->getType();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:

View File

@ -9694,7 +9694,8 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
unsigned CopyAlign = MI->getAlignment();
if (CopyAlign < MinAlign) {
MI->setAlignment(MinAlign);
MI->setAlignment(Context->getConstantInt(MI->getAlignmentType(),
MinAlign, false));
return MI;
}
@ -9768,7 +9769,8 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
unsigned Alignment = GetOrEnforceKnownAlignment(MI->getDest());
if (MI->getAlignment() < Alignment) {
MI->setAlignment(Alignment);
MI->setAlignment(Context->getConstantInt(MI->getAlignmentType(),
Alignment, false));
return MI;
}