[llvm] [ConstraintElim] Check the other signedness when hasSameSign (PR #128168)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 07:49:02 PST 2025


================
@@ -303,3 +303,23 @@ define i1 @ugt_assumed_positive_values(i8 %a, i8 %b) {
 
   ret i1 %result
 }
+
+define i1 @samesign_flipped_signedness(i8 %a)  {
+; CHECK-LABEL: @samesign_flipped_signedness(
+; CHECK-NEXT:    [[TMP1:%.*]] = icmp ugt i8 [[A:%.*]], 0
+; CHECK-NEXT:    br i1 [[TMP1]], label [[GREATER:%.*]], label [[EXIT:%.*]]
+; CHECK:       greater:
+; CHECK-NEXT:    ret i1 true
+; CHECK:       exit:
+; CHECK-NEXT:    ret i1 false
+;
+  %1 = icmp ugt i8 %a, 0
----------------
dtcxzyw wrote:

Use named values.

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


More information about the llvm-commits mailing list