[llvm] [SimplfiyLibCalls] Constant fold `remquo` (PR #99647)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 19 07:39:02 PDT 2024
================
@@ -49,16 +49,40 @@ entry:
ret double %call
}
-define double @remquo_f80(ptr %quo) {
-; CHECK-LABEL: define double @remquo_f80(
+define x86_fp80 @remquo_f80(ptr %quo) {
+; CHECK-LABEL: define x86_fp80 @remquo_f80(
; CHECK-SAME: ptr [[QUO:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
-; CHECK-NEXT: [[CALL:%.*]] = call double @remquol(x86_fp80 0xKC001A000000000000000, x86_fp80 0xK4000C000000000000000, ptr [[QUO]])
-; CHECK-NEXT: ret double [[CALL]]
+; CHECK-NEXT: store i32 -2, ptr [[QUO]], align 4
+; CHECK-NEXT: ret x86_fp80 0xK3FFF8000000000000000
;
entry:
- %call = call double @remquol(x86_fp80 0xKC001A000000000000000, x86_fp80 0xK4000C000000000000000, ptr %quo)
- ret double %call
+ %call = call x86_fp80 @remquol(x86_fp80 0xKC001A000000000000000, x86_fp80 0xK4000C000000000000000, ptr %quo)
+ ret x86_fp80 %call
+}
+
+define fp128 @remquo_fp128(ptr %quo) {
+; CHECK-LABEL: define fp128 @remquo_fp128(
+; CHECK-SAME: ptr [[QUO:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CALL:%.*]] = call fp128 @remquol(fp128 0xL0000000000000000C001400000000000, fp128 0xL00000000000000004000800000000000, ptr [[QUO]])
+; CHECK-NEXT: ret fp128 [[CALL]]
+;
+entry:
+ %call = call fp128 @remquol(fp128 0xL0000000000000000C001400000000000, fp128 0xL00000000000000004000800000000000, ptr %quo)
----------------
arsenm wrote:
I don't think these different long double variants can coexist in the same test?
https://github.com/llvm/llvm-project/pull/99647
More information about the llvm-commits
mailing list