The patch https://reviews.llvm.org/D29014 has added the new ISD::FREEZE and can deal with the integer.
The patch https://reviews.llvm.org/D76980 has added SoftenFloatRes_FREEZE for float point.
But from below code, we can know ppc_fp128, it needs expand.
1193 // ppcf128 type is really two f64's. 1194 if (!isTypeLegal(MVT::ppcf128)) { 1195 if (isTypeLegal(MVT::f64)) { 1196 NumRegistersForVT[MVT::ppcf128] = 2*NumRegistersForVT[MVT::f64]; 1197 RegisterTypeForVT[MVT::ppcf128] = MVT::f64; 1198 TransformToType[MVT::ppcf128] = MVT::f64; 1199 ValueTypeActions.setTypeAction(MVT::ppcf128, TypeExpandFloat); 1200 } else { 1201 NumRegistersForVT[MVT::ppcf128] = NumRegistersForVT[MVT::i128]; 1202 RegisterTypeForVT[MVT::ppcf128] = RegisterTypeForVT[MVT::i128]; 1203 TransformToType[MVT::ppcf128] = MVT::i128; 1204 ValueTypeActions.setTypeAction(MVT::ppcf128, TypeSoftenFloat); 1205 } 1206 }
Some cases have gotten assertion for lack of expand for ppc_fp128. For example, below case:
cat ppcf128.mir
--- | define ppc_fp128 @freeze_select(ppc_fp128 %a, ppc_fp128 %b) { %sel.frozen = freeze ppc_fp128 %a %cmp = fcmp one ppc_fp128 %sel.frozen, 0xM00000000000000000000000000000000 br i1 %cmp, label %select.end, label %select.false select.false: ; preds = %0 br label %select.end select.end: ; preds = %0, %select.false %sel = phi ppc_fp128 [ %a, %0 ], [ %b, %select.false ] ret ppc_fp128 %sel } ...
Using below command:
llc -mtriple powerpc64le-unknown-linux-gnu -start-after=codegenprepare ppcf128.mir
You will get below error:
ExpandFloatResult #0: t33: ppcf128 = freeze t9 Do not know how to expand the result of this operator! UNREACHABLE executed at /home/shkzhang/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1122!
This patch is to support freeze expand for ppc_fp128 to fix the above error.