-
Notifications
You must be signed in to change notification settings - Fork 15k
Open
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes
Description
For the following IR, where the fp-to-int conversion is a vector operation:
%33 = call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %26, i32 9)
%34 = fptosi <4 x float> %33 to <4 x i32>
br label %35
35:
%36 = phi i32 [0, %10], [ %59, %58]
%37 = icmp samesign ult i32 %36, 4
br i1 %37, label %38, label %60
38:
%40 = extractelement <4 x i32> %34, i32 %36After running the InstCombine pass, the conversion becomes scalarized and moved inside the loop:
%30 = call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %26, i32 9)
br label %31
31:
%32 = phi i32 [0, %10], [ %59, %58]
%33 = icmp samesign ult i32 %32, 4
br i1 %33, label %34, label %60
34:
%37 = extractelement <4 x float> %30, i32 %32
%38 = fptosi float %37 to i32This transformation appears incorrect, since it changes a vector fp-to-int conversion into a scalar one and moves it inside the loop.
I will prepare a baseline test that reproduces the issue, along with a proposal for a bug fix.
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passes