This is an archive of the discontinued LLVM Phabricator instance.

[ISEL] Legalize arithmetic.fence.f128 for 32-bits target
ClosedPublic

Authored by xiangzhangllvm on Sep 24 2021, 7:52 PM.

Details

Summary

We meet an ERROR about arithmetic fence in building some libs in m32 target.
The reason is Legalize not consider "transfer/convert" illegal type fp128 (in m32) for arithmetic.fence.
Now fix it.

clang -cc1 -triple i386-pc-linux-gnu -mreassociate t.c -emit-llvm -o t.ll; llc t.l
clang -cc1 -triple i386-pc-linux-gnu -mreassociate -S -o t.s -x c t.c

typedef __float128 TYPE;

TYPE foo(TYPE *qr) {
TYPE re =__arithmetic_fence(*qr);
return re;
}

Diff Detail

Event Timeline

xiangzhangllvm created this revision.Sep 24 2021, 7:52 PM
xiangzhangllvm requested review of this revision.Sep 24 2021, 7:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2021, 7:52 PM

Update clang-format (some places keep same style with the existed code)

xiangzhangllvm edited the summary of this revision. (Show Details)Sep 25 2021, 7:26 PM
pengfei added inline comments.Sep 25 2021, 7:32 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
210

Can we do the same think as SoftenFloatRes_FREEZE?

xiangzhangllvm added inline comments.Sep 26 2021, 9:21 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
210

Actually they are same, SoftenFloatRes_FREEZE looks more standard, let me change it soon, thanks a lot!

Refine, let it follow with SoftenFloatRes_FREEZE style.

pengfei accepted this revision.Sep 27 2021, 1:24 AM

LGTM.

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
212–214

Nit: We can return it directly.

This revision is now accepted and ready to land.Sep 27 2021, 1:24 AM
xiangzhangllvm marked an inline comment as done.Sep 27 2021, 1:58 AM
xiangzhangllvm added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
212–214

Yes, seems no affect, let it be (at least easy for debug). : )

This revision was landed with ongoing or failed builds.Sep 27 2021, 7:27 PM
This revision was automatically updated to reflect the committed changes.