[llvm] b2c7cac - llvm-reduce: Handle disjoint flag

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 20:13:19 PST 2023


Author: Matt Arsenault
Date: 2023-12-13T11:13:09+07:00
New Revision: b2c7cac3ad0a642bcb5c0805c79d4a6e933112ad

URL: https://github.com/llvm/llvm-project/commit/b2c7cac3ad0a642bcb5c0805c79d4a6e933112ad
DIFF: https://github.com/llvm/llvm-project/commit/b2c7cac3ad0a642bcb5c0805c79d4a6e933112ad.diff

LOG: llvm-reduce: Handle disjoint flag

Added: 
    

Modified: 
    llvm/test/tools/llvm-reduce/reduce-flags.ll
    llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-reduce/reduce-flags.ll b/llvm/test/tools/llvm-reduce/reduce-flags.ll
index 429086effce80..036bfdc84ac43 100644
--- a/llvm/test/tools/llvm-reduce/reduce-flags.ll
+++ b/llvm/test/tools/llvm-reduce/reduce-flags.ll
@@ -216,3 +216,19 @@ define i64 @zext_nneg_keep(i32 %a) {
   %op = zext nneg i32 %a to i64
   ret i64 %op
 }
+
+; CHECK-LABEL: @or_disjoint_drop(
+; INTERESTING: = or
+; RESULT: or i32
+define i32 @or_disjoint_drop(i32 %a, i32 %b) {
+  %op = or disjoint i32 %a, %b
+  ret i32 %op
+}
+
+; CHECK-LABEL: @or_disjoint_keep(
+; INTERESTING: = or disjoint
+; RESULT: or disjoint i32
+define i32 @or_disjoint_keep(i32 %a, i32 %b) {
+  %op = or disjoint i32 %a, %b
+  ret i32 %op
+}

diff  --git a/llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp b/llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp
index 96d3de01af7de..7b6fe7e5f9173 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp
@@ -33,6 +33,9 @@ static void reduceFlagsInModule(Oracle &O, ReducerWorkItem &WorkItem) {
       } else if (auto *NNI = dyn_cast<PossiblyNonNegInst>(&I)) {
         if (NNI->hasNonNeg() && !O.shouldKeep())
           NNI->setNonNeg(false);
+      } else if (auto *PDI = dyn_cast<PossiblyDisjointInst>(&I)) {
+        if (PDI->isDisjoint() && !O.shouldKeep())
+          PDI->setIsDisjoint(false);
       } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
         if (GEP->isInBounds() && !O.shouldKeep())
           GEP->setIsInBounds(false);


        


More information about the llvm-commits mailing list