mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 12:50:00 +00:00
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:
parent
8b98b85c64
commit
a547b4708b
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user