1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -reassociate < %s | FileCheck %s
4 ; Check that if constants combine to an absorbing value then the expression is
5 ; evaluated as the absorbing value.
7 define i8 @or_all_ones(i8 %x) {
8 ; CHECK-LABEL: @or_all_ones(
9 ; CHECK-NEXT: ret i8 -1
12 %tmp2 = or i8 %tmp1, 128
16 ; TODO: fmul by 0.0 with nsz+nnan should have simplified to 0.0.
18 define double @fmul_zero(double %x) {
19 ; CHECK-LABEL: @fmul_zero(
20 ; CHECK-NEXT: [[R:%.*]] = fmul fast double [[X:%.*]], 0.000000e+00
21 ; CHECK-NEXT: ret double [[R]]
23 %x4 = fmul fast double %x, 4.0
24 %r = fmul fast double %x4, 0.0