[PATCH] D126895: [SLP] Phi inputs that come from an unreachable block should be undef.
Vasileios Porpodas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 2 11:42:53 PDT 2022
vporpo added a comment.
I think that the issue boils down to whether: `%zext = zext i8 poison to i32` is an i32 poison.
Instcombine is folding zext into phis like so:
For a phi with an undef input:
bb1:
br label %bb3
bb2:
br label %bb3
bb3:
%phi = phi <2 x i8> [ %arg, %bb1 ], [ <i8 1, i8 undef>, %bb2 ]
%zext = zext <2 x i8> %phi to <2 x i32>
Instcombine will fold the zext into phi like this:
bb1:
%phi.cast = zext <2 x i8> %arg to <2 x i32>
br label %bb3
bb2: ; No predecessors!
br label %bb3
bb3: ; preds = %bb2, %bb1
%phi = phi <2 x i32> [ %phi.cast, %bb1 ], [ <i32 1, i32 0>, %bb2 ]
But for a phi with a poison input it will generate this:
bb1:
%phi.cast = zext <2 x i8> %arg to <2 x i32>
br label %bb3
bb2: ; No predecessors!
br label %bb3
bb3: ; preds = %bb2, %bb1
%phi = phi <2 x i32> [ %phi.cast, %bb1 ], [ <i32 1, i32 poison>, %bb2 ]
The input from %bb2 is now an i32 poison, which does not seem to hold the same properties as a zero-extended i8 poison.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126895/new/
https://reviews.llvm.org/D126895
More information about the llvm-commits
mailing list