aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2025-05-23 14:59:18 +0100
committerGitHub <noreply@github.com>2025-05-23 14:59:18 +0100
commit34813d9d384fc97e4c20e4dc4a8d2099392d46a6 (patch)
tree54b13212fdc39c87850b241607544acab04e9c11 /llvm/lib/Transforms/Utils/Local.cpp
parent50304b0806e4f9c8001c024925566c9b88e7176e (diff)
downloadllvm-34813d9d384fc97e4c20e4dc4a8d2099392d46a6.zip
llvm-34813d9d384fc97e4c20e4dc4a8d2099392d46a6.tar.gz
llvm-34813d9d384fc97e4c20e4dc4a8d2099392d46a6.tar.bz2
[Reassociate] Move Disjoint flag handling to OverflowTracking. (#140406)
Move disjoint flag tracking to OverflowTracking. This enables preserving disjoint flags in Reassociate. Depends on https://github.com/llvm/llvm-project/pull/140404 PR: https://github.com/llvm/llvm-project/pull/140406
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 4d168ce..69dcd30 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -4368,6 +4368,8 @@ void OverflowTracking::mergeFlags(Instruction &I) {
HasNUW &= I.hasNoUnsignedWrap();
HasNSW &= I.hasNoSignedWrap();
}
+ if (auto *DisjointOp = dyn_cast<PossiblyDisjointInst>(&I))
+ IsDisjoint &= DisjointOp->isDisjoint();
}
void OverflowTracking::applyFlags(Instruction &I) {
@@ -4379,4 +4381,6 @@ void OverflowTracking::applyFlags(Instruction &I) {
if (HasNSW && (AllKnownNonNegative || HasNUW))
I.setHasNoSignedWrap();
}
+ if (auto *DisjointOp = dyn_cast<PossiblyDisjointInst>(&I))
+ DisjointOp->setIsDisjoint(IsDisjoint);
}