This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Update Alignment of ReuseLoadInfo in PPCTargetLowering::LowerFP_TO_INTForReuse
AbandonedPublic

Authored by lkail on Mar 28 2020, 3:35 AM.

Details

Reviewers
nemanjai
steven.zhang
hfinkel
Group Reviewers
Restricted Project
Summary

Current PowerPC backend fails to compile the attached test case, hitting an assertion error

llvm-project/llvm/include/llvm/Support/Alignment.h:78: llvm::Align::Align(uint64_t): Assertion `Value > 0 && "Value must not be 0"' failed.

PowerPC backend wants to emit such code sequence

fctiwz ...
stfiwx ...
lfiwax ...

for LLVM IR

%b = fptosi float %a to i32
%c = sitofp i32 %b to float

on targets without VSX support(e.g. building a linux kernel). When emitting stfiwx, Alignment of ReuseLoadInfo is supposed to be updated in PPCTargetLowering::LowerFP_TO_INTForReuse so that following emit of lfiwax can know the alignment.

Diff Detail

Event Timeline

lkail created this revision.Mar 28 2020, 3:35 AM
lkail updated this revision to Diff 253736.Mar 30 2020, 4:04 PM

Rebased.

lkail set the repository for this revision to rG LLVM Github Monorepo.Mar 30 2020, 4:17 PM
lkail abandoned this revision.Mar 31 2020, 8:06 PM

Should be fixed by 998118c3d3bd6a394c1da35f7570cce1a3145ea3, which does more checks on alignment.

lkail added a comment.Apr 6 2020, 8:24 PM

Resubmit a new patch to get correct alignment. https://reviews.llvm.org/D77624