mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Change name of copyFlags() to copyIRFlags(). Add convenience method for logical 'and' of all flags. NFC.
Adding 'IR' to the names in an attempt to be less ambiguous about the flags we're dealing with here. The 'and' method is needed by the SLPVectorizer (PR20802) and possibly other passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2030,7 +2030,7 @@ bool BinaryOperator::isExact() const {
|
||||
return cast<PossiblyExactOperator>(this)->isExact();
|
||||
}
|
||||
|
||||
void BinaryOperator::copyFlags(const Value *V) {
|
||||
void BinaryOperator::copyIRFlags(const Value *V) {
|
||||
// Copy the wrapping flags.
|
||||
if (auto *OB = dyn_cast<OverflowingBinaryOperator>(V)) {
|
||||
setHasNoSignedWrap(OB->hasNoSignedWrap());
|
||||
@@ -2046,6 +2046,23 @@ void BinaryOperator::copyFlags(const Value *V) {
|
||||
copyFastMathFlags(FP->getFastMathFlags());
|
||||
}
|
||||
|
||||
void BinaryOperator::andIRFlags(const Value *V) {
|
||||
if (auto *OB = dyn_cast<OverflowingBinaryOperator>(V)) {
|
||||
setHasNoSignedWrap(hasNoSignedWrap() & OB->hasNoSignedWrap());
|
||||
setHasNoUnsignedWrap(hasNoUnsignedWrap() & OB->hasNoUnsignedWrap());
|
||||
}
|
||||
|
||||
if (auto *PE = dyn_cast<PossiblyExactOperator>(V))
|
||||
setIsExact(isExact() & PE->isExact());
|
||||
|
||||
if (auto *FP = dyn_cast<FPMathOperator>(V)) {
|
||||
FastMathFlags FM = getFastMathFlags();
|
||||
FM &= FP->getFastMathFlags();
|
||||
copyFastMathFlags(FM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// FPMathOperator Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user