https://bugs.llvm.org/show_bug.cgi?id=42823

            Bug ID: 42823
           Summary: [DivRemPairs] Broken handling of RAUW
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

https://reviews.llvm.org/D65298 added recomposition of expanded form of rem
into rem instruction, and that broke test-suite.
The bug is due to the fact that that pass does RAUW, but does nothing
about it's internal maps, the Values in them don't get updated.

That variation of a bug can be exposed even without that patch with this IR:

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "aarch64-unknown-linux-gnu"

define i32 @d(i32 %X, i32 %Y, i32 %Z) {
bb:
  %t0 = mul nsw i32 %Z, %Y
  %t1 = sdiv i32 %X, %t0
  %t2 = mul nsw i32 %t0, %t1
  %t3.recomposed = srem i32 %X, %t0
  %t4 = sdiv i32 %t3.recomposed, %Y
  %t5 = mul nsw i32 %t4, %Y
  %t6.recomposed = srem i32 %t3.recomposed, %Y
  ret i32 %t6.recomposed
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to