mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders, done in this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
11eab02b77
commit
3548ea8e90
@ -654,6 +654,7 @@ public:
|
||||
static Constant *getBitCast (Constant *C, const Type *Ty);
|
||||
|
||||
static Constant* getNSWAdd(Constant* C1, Constant* C2);
|
||||
static Constant* getNSWSub(Constant* C1, Constant* C2);
|
||||
static Constant* getExactSDiv(Constant* C1, Constant* C2);
|
||||
|
||||
/// Transparently provide more efficient getOperand methods.
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
Constant *CreateSub(Constant *LHS, Constant *RHS) const {
|
||||
return ConstantExpr::getSub(LHS, RHS);
|
||||
}
|
||||
Constant *CreateNSWSub(Constant *LHS, Constant *RHS) const {
|
||||
return ConstantExpr::getNSWSub(LHS, RHS);
|
||||
}
|
||||
Constant *CreateFSub(Constant *LHS, Constant *RHS) const {
|
||||
return ConstantExpr::getFSub(LHS, RHS);
|
||||
}
|
||||
|
@ -51,6 +51,9 @@ public:
|
||||
Value *CreateSub(Constant *LHS, Constant *RHS) const {
|
||||
return BinaryOperator::CreateSub(LHS, RHS);
|
||||
}
|
||||
Value *CreateNSWSub(Constant *LHS, Constant *RHS) const {
|
||||
return BinaryOperator::CreateNSWSub(LHS, RHS);
|
||||
}
|
||||
Value *CreateFSub(Constant *LHS, Constant *RHS) const {
|
||||
return BinaryOperator::CreateFSub(LHS, RHS);
|
||||
}
|
||||
|
@ -60,6 +60,9 @@ public:
|
||||
Constant *CreateSub(Constant *LHS, Constant *RHS) const {
|
||||
return Fold(ConstantExpr::getSub(LHS, RHS));
|
||||
}
|
||||
Constant *CreateNSWSub(Constant *LHS, Constant *RHS) const {
|
||||
return Fold(ConstantExpr::getNSWSub(LHS, RHS));
|
||||
}
|
||||
Constant *CreateFSub(Constant *LHS, Constant *RHS) const {
|
||||
return Fold(ConstantExpr::getFSub(LHS, RHS));
|
||||
}
|
||||
|
@ -643,6 +643,11 @@ Constant* ConstantExpr::getNSWAdd(Constant* C1, Constant* C2) {
|
||||
OverflowingBinaryOperator::NoSignedWrap);
|
||||
}
|
||||
|
||||
Constant* ConstantExpr::getNSWSub(Constant* C1, Constant* C2) {
|
||||
return getTy(C1->getType(), Instruction::Sub, C1, C2,
|
||||
OverflowingBinaryOperator::NoSignedWrap);
|
||||
}
|
||||
|
||||
Constant* ConstantExpr::getExactSDiv(Constant* C1, Constant* C2) {
|
||||
return getTy(C1->getType(), Instruction::SDiv, C1, C2,
|
||||
SDivOperator::IsExact);
|
||||
|
Loading…
x
Reference in New Issue
Block a user