[PATCH] D35374: AMDGPU: Fix handling of div_scale with undef inputs

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 12:44:36 PDT 2017


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:3625
     if (!Param)
-      return DAG.getUNDEF(VT);
+      return DAG.getMergeValues({ DAG.getUNDEF(VT), DAG.getUNDEF(MVT::i1) }, DL);
 
----------------
arsenm wrote:
> rampitec wrote:
> > Is it really needed? If the parameter required to be a constant why not just error out?
> Yes. If using a proper error message (i.e. not report_fatal_error) there isn't a way to abort the compilation here and you still need to produce something. The problem here before was the type didn't match since this expects to produce 2 values.
undef also is a constant, just not a ConstantInt


https://reviews.llvm.org/D35374





More information about the llvm-commits mailing list