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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 17:53:27 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
----------------
nikic wrote:

> I think the issue is that UseBlockValue is false so we don't actually compute the %x.1 CR when evaluating the inbounds cmp.

Yes, we don't use block values when deriving information from select conditions right now. I'm not sure doing this is viable, especially in the at-use logic.

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


More information about the llvm-commits mailing list