
This patch adds constant folding support for `remquo`. Reference: https://en.cppreference.com/w/cpp/numeric/math/remquo Closes https://github.com/llvm/llvm-project/issues/99497.
17 lines
600 B
LLVM
17 lines
600 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
|
|
define x86_fp80 @remquo_fp80(ptr %quo) {
|
|
; CHECK-LABEL: define x86_fp80 @remquo_fp80(
|
|
; CHECK-SAME: ptr [[QUO:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: store i32 -2, ptr [[QUO]], align 4
|
|
; CHECK-NEXT: ret x86_fp80 0xK3FFF8000000000000000
|
|
;
|
|
entry:
|
|
%call = call x86_fp80 @remquol(x86_fp80 0xKC001A000000000000000, x86_fp80 0xK4000C000000000000000, ptr %quo)
|
|
ret x86_fp80 %call
|
|
}
|
|
|
|
declare x86_fp80 @remquol(x86_fp80, x86_fp80, ptr)
|