
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
608 B
LLVM
17 lines
608 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 fp128 @remquo_fp128(ptr %quo) {
|
|
; CHECK-LABEL: define fp128 @remquo_fp128(
|
|
; CHECK-SAME: ptr [[QUO:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: store i32 -2, ptr [[QUO]], align 4
|
|
; CHECK-NEXT: ret fp128 0xL00000000000000003FFF000000000000
|
|
;
|
|
entry:
|
|
%call = call fp128 @remquol(fp128 0xL0000000000000000C001400000000000, fp128 0xL00000000000000004000800000000000, ptr %quo)
|
|
ret fp128 %call
|
|
}
|
|
|
|
declare fp128 @remquol(fp128, fp128, ptr)
|