[llvm] r336208 - [Reassociate] add test for missing FP constant analysis; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 3 08:56:04 PDT 2018
Author: spatel
Date: Tue Jul 3 08:56:04 2018
New Revision: 336208
URL: http://llvm.org/viewvc/llvm-project?rev=336208&view=rev
Log:
[Reassociate] add test for missing FP constant analysis; NFC
Modified:
llvm/trunk/test/Transforms/Reassociate/absorption.ll
Modified: llvm/trunk/test/Transforms/Reassociate/absorption.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Reassociate/absorption.ll?rev=336208&r1=336207&r2=336208&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Reassociate/absorption.ll (original)
+++ llvm/trunk/test/Transforms/Reassociate/absorption.ll Tue Jul 3 08:56:04 2018
@@ -1,11 +1,27 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -reassociate < %s | FileCheck %s
; Check that if constants combine to an absorbing value then the expression is
; evaluated as the absorbing value.
-define i8 @foo(i8 %x) {
+
+define i8 @or_all_ones(i8 %x) {
+; CHECK-LABEL: @or_all_ones(
+; CHECK-NEXT: ret i8 -1
+;
%tmp1 = or i8 %x, 127
%tmp2 = or i8 %tmp1, 128
ret i8 %tmp2
-; CHECK-LABEL: @foo(
-; CHECK: ret i8 -1
}
+
+; TODO: fmul by 0.0 with nsz+nnan should have simplified to 0.0.
+
+define double @fmul_zero(double %x) {
+; CHECK-LABEL: @fmul_zero(
+; CHECK-NEXT: [[R:%.*]] = fmul fast double [[X:%.*]], 0.000000e+00
+; CHECK-NEXT: ret double [[R]]
+;
+ %x4 = fmul fast double %x, 4.0
+ %r = fmul fast double %x4, 0.0
+ ret double %r
+}
+
More information about the llvm-commits
mailing list