Skip to content

Commit b2c7cac

Browse files
committed
llvm-reduce: Handle disjoint flag
1 parent 82d7502 commit b2c7cac

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

llvm/test/tools/llvm-reduce/reduce-flags.ll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,19 @@ define i64 @zext_nneg_keep(i32 %a) {
216216
%op = zext nneg i32 %a to i64
217217
ret i64 %op
218218
}
219+
220+
; CHECK-LABEL: @or_disjoint_drop(
221+
; INTERESTING: = or
222+
; RESULT: or i32
223+
define i32 @or_disjoint_drop(i32 %a, i32 %b) {
224+
%op = or disjoint i32 %a, %b
225+
ret i32 %op
226+
}
227+
228+
; CHECK-LABEL: @or_disjoint_keep(
229+
; INTERESTING: = or disjoint
230+
; RESULT: or disjoint i32
231+
define i32 @or_disjoint_keep(i32 %a, i32 %b) {
232+
%op = or disjoint i32 %a, %b
233+
ret i32 %op
234+
}

llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ static void reduceFlagsInModule(Oracle &O, ReducerWorkItem &WorkItem) {
3333
} else if (auto *NNI = dyn_cast<PossiblyNonNegInst>(&I)) {
3434
if (NNI->hasNonNeg() && !O.shouldKeep())
3535
NNI->setNonNeg(false);
36+
} else if (auto *PDI = dyn_cast<PossiblyDisjointInst>(&I)) {
37+
if (PDI->isDisjoint() && !O.shouldKeep())
38+
PDI->setIsDisjoint(false);
3639
} else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
3740
if (GEP->isInBounds() && !O.shouldKeep())
3841
GEP->setIsInBounds(false);

0 commit comments

Comments
 (0)