[llvm] [CVP] Use at-use info in `processBinOp` (PR #88523)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 08:09:54 PDT 2024


================
@@ -596,3 +596,37 @@ define i16 @and_elide_poison_flags_missing_noundef(i16 %a) {
   %sel = select i1 %cmp, i16 %and, i16 24
   ret i16 %sel
 }
+
+define i32 @pr87854(i32 noundef %x.1, i32 noundef %i) {
+; CHECK-LABEL: @pr87854(
+; CHECK-NEXT:    [[COND:%.*]] = icmp sgt i32 [[X_1:%.*]], -1
+; CHECK-NEXT:    tail call void @llvm.assume(i1 [[COND]])
+; CHECK-NEXT:    [[INBOUNDS:%.*]] = icmp ult i32 [[I:%.*]], [[X_1]]
+; CHECK-NEXT:    [[NEXT:%.*]] = add nuw i32 [[I]], 1
----------------
dtcxzyw wrote:

I don't know why the nsw flag cannot be inferred from the assumption. `intersectAssumeOrGuardBlockValueConstantRange` should handle this case.


https://github.com/llvm/llvm-project/pull/88523


More information about the llvm-commits mailing list