[llvm] [InstCombine] Fix FMF propagation in `foldSelectIntoOp` (PR #114356)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 13:18:27 PDT 2024


gulfemsavrun wrote:

We also started seeing a test failure:
```
FAIL: LLVM :: Transforms/PhaseOrdering/AArch64/predicated-reduction.ll (46966 of 56618)
******************** TEST 'LLVM :: Transforms/PhaseOrdering/AArch64/predicated-reduction.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /b/s/w/ir/x/w/llvm_build/bin/opt -passes="default<O3>" -S < /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll  | /b/s/w/ir/x/w/llvm_build/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll
+ /b/s/w/ir/x/w/llvm_build/bin/opt '-passes=default<O3>' -S
+ /b/s/w/ir/x/w/llvm_build/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll
/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll:26:15: error: CHECK-NEXT: expected string not found in input
; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <2 x double> [ zeroinitializer, %[[VECTOR_PH]] ], [ [[TMP18:%.*]], %[[VECTOR_BODY]] ]
              ^
<stdin>:26:67: note: scanning from here
 %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
                                                                  ^
<stdin>:26:67: note: with "VECTOR_PH" equal to "vector\\.ph"
 %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
                                                                  ^
<stdin>:26:67: note: with "VECTOR_BODY" equal to "vector\\.body"
 %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
                                                                  ^
<stdin>:39:9: note: possible intended match here
 %8 = fcmp fast ogt <2 x double> %6, zeroinitializer
        ^
/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll:349:12: error: undefined variable: LOOP0
; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
           ^
/b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll:349:35: error: undefined variable: LOOP0
; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
                                  ^
<stdin>:172:2: note: possible intended match here
!0 = distinct !{!0, !1, !2}
 ^

Input file: <stdin>
Check file: /b/s/w/ir/x/w/llvm-llvm-project/llvm/test/Transforms/PhaseOrdering/AArch64/predicated-reduction.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
             .
             .
             .
            21:  %broadcast.splatinsert17 = insertelement <2 x double> poison, double %Z, i64 0 
            22:  %broadcast.splat18 = shufflevector <2 x double> %broadcast.splatinsert17, <2 x double> poison, <2 x i32> zeroinitializer 
            23:  br label %vector.body 
            24:  
            25: vector.body: ; preds = %vector.body, %vector.ph 
            26:  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] 
next:26'0                                                                         X error: no match found
next:26'1                                                                           with "VECTOR_PH" equal to "vector\\.ph"
next:26'2                                                                           with "VECTOR_BODY" equal to "vector\\.body"
            27:  %vec.phi = phi double [ 0.000000e+00, %vector.ph ], [ %17, %vector.body ] 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            28:  %vec.phi15 = phi double [ 0.000000e+00, %vector.ph ], [ %19, %vector.body ] 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            29:  %0 = getelementptr inbounds float, ptr %samples, i64 %index 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            30:  %1 = getelementptr inbounds i8, ptr %0, i64 8 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            31:  %wide.load = load <2 x float>, ptr %0, align 4 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             .
             .
             .
            34:  %3 = fpext <2 x float> %wide.load16 to <2 x double> 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            35:  %4 = fmul fast <2 x double> %broadcast.splat, %2 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            36:  %5 = fmul fast <2 x double> %broadcast.splat, %3 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            37:  %6 = fsub fast <2 x double> %4, %broadcast.splat18 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            38:  %7 = fsub fast <2 x double> %5, %broadcast.splat18 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            39:  %8 = fcmp fast ogt <2 x double> %6, zeroinitializer 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:26'3               ?                                             possible intended match
            40:  %9 = fcmp fast ogt <2 x double> %7, zeroinitializer 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            41:  %10 = fmul fast <2 x double> %6, %6 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            42:  %11 = fmul fast <2 x double> %7, %7 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            43:  %12 = tail call fast <2 x double> @llvm.maxnum.v2f64(<2 x double> %6, <2 x double> <double -0.000000e+00, double -0.000000e+00>) 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            44:  %13 = tail call fast <2 x double> @llvm.maxnum.v2f64(<2 x double> %7, <2 x double> <double -0.000000e+00, double -0.000000e+00>) 
next:26'0       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             .
             .
             .
           146:  
           147: for.end10: ; preds = %for.body, %for.cond1.for.inc8_crit_edge.us, %entry 
           148:  %v0.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %v0.2.us, %for.cond1.for.inc8_crit_edge.us ], [ 0.000000e+00, %for.body ] 
           149:  %v1.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %v1.2.us, %for.cond1.for.inc8_crit_edge.us ], [ 0.000000e+00, %for.body ] 
           150:  %add11 = fadd fast double %v1.0.lcssa, %v0.0.lcssa 
           151:  ret double %add11 
check:349'0                       X error: match failed for invalid pattern
check:349'1                         undefined variable: LOOP0
check:349'2                         undefined variable: LOOP0
           152: } 
check:349'0     ~~
           153:  
check:349'0     ~
           154: declare void @resample(i32 noundef, ptr noundef) local_unnamed_addr 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           155:  
check:349'0     ~
           156: ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             .
             .
             .
           167:  
check:349'0     ~
           168: attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) } 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           169: attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           170: attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           171:  
check:349'0     ~
           172: !0 = distinct !{!0, !1, !2} 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:349'3      ?                           possible intended match
           173: !1 = !{!"llvm.loop.isvectorized", i32 1} 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           174: !2 = !{!"llvm.loop.unroll.runtime.disable"} 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           175: !3 = distinct !{!3, !2, !1} 
check:349'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

--

********************
```
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-base-linux-x64/b8732549597609293617/overview

https://github.com/llvm/llvm-project/pull/114356


More information about the llvm-commits mailing list