[PATCH] D49806: [FPEnv] Widen illegal width StrictFP vector operations as needed

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 12:29:50 PDT 2018


cameron.mcinally added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2607
+    if (Oper.getValueType().isVector())
+      Oper = GetWidenedVector(N->getOperand(i));
+
----------------
craig.topper wrote:
> cameron.mcinally wrote:
> > craig.topper wrote:
> > > Add an assert here that the operand VT matches the destination VT when we call GetWidenedVector?
> > That assert won't be valid for converts (yet to be added) and possibly other strict instructions.
> Agreed, but the GetWidenedVector call isn't valid without that guarantee. You would need to check if the type is also supposed to be widened and if not you would have to do your own widening.
> 
> But the variable "VT" and its use in the EXTRACT_SUBVECTOR in the loop below are also wrong if the input type doesn't match the result type. Probably other things as well.
Ah, good point. I misunderstood how GetWidenedVector(...) worked.

I'm looking at WidenVecRes_Convert(...) now and suspect that we should also have a separate function to widen the StrictFP converts. Does this sound okay with you?

If so, I'll add the assert to WidenVecRes_StrictFP(...) now and we can revisit the converts once the intrinsics are added and there is a test case.


Repository:
  rL LLVM

https://reviews.llvm.org/D49806





More information about the llvm-commits mailing list