[PATCH] D137862: InstCombine: Fold some identities for canonicalize
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 18 11:43:57 PST 2022
arsenm added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/canonicalize.ll:284
-; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]])
-; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[CANON_X]], [[X]]
; CHECK-NEXT: ret i1 [[CMP]]
----------------
spatel wrote:
> This isn't testing what was intended. The operands are canonicalized by complexity before we reach the transform in this patch.
>
> It needs an extra instruction to create the expected pattern:
>
> ```
> declare float @gen_f32()
>
> define i1 @canonicalize_oeq_arg_f32_commute() {
> %x = call float @gen_f32() ; thwart complexity-based canonicalization
> %canon.x = call float @llvm.canonicalize.f32(float %x)
> %cmp = fcmp oeq float %x, %canon.x
> ret i1 %cmp
> }
>
> ```
I thought the idea was to rely on the complexity based canonicalization, but I guess that's not good enough
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137862/new/
https://reviews.llvm.org/D137862
More information about the llvm-commits
mailing list