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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 10:19:19 PDT 2018


craig.topper added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2716
+      // Vector type, create a CONCAT_VECTORS of type NextVT
+      SDValue undefVec = DAG.getUNDEF(VT);
+      unsigned OpsToConcat = NextSize/VT.getVectorNumElements();
----------------
cameron.mcinally wrote:
> craig.topper wrote:
> > Is widening with undef safe for a strict instruction?
> No, it's not safe to insert undef values into a strict instruction, but I don't think that's what this code is doing.
> 
> Maybe I'm misunderstanding this code, but I believe this is performing the original operation at a smaller legal width(s) and then concat'ing the result of the operation(s) with undef values to the next largest legal vector type. That should be fine since it won't introduce a trap that did not exist in the user's code.
Ok. I didn't look closely. I just know most of our widening code widens with undef. Maybe the trap code you copied doesn't do that. Let me actually read this patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D49806





More information about the llvm-commits mailing list