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

            Bug ID: 50575
           Summary: [InstCombine] remove unnecessary truncate
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Forking this off from bug 49543 - we can eliminate an intermediate cast in a
sequence like this by using 'ashr' to replicate the signbit: 

define i64 @src(i32 %a0) {
  %a = lshr i32 %a0, 24
  %b = trunc i32 %a to i8
  %c = sext i8 %b to i64
  ret i64 %c
}

define i64 @tgt(i32 %a0) {
  %a = ashr i32 %a0, 24
  %c = sext i32 %a to i64
  ret i64 %c
}

-- 
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