[PATCH] D44786: Lowering x86 adds/addus/subs/subus intrinsics (clang)

Tomasz Krupa via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 29 07:19:14 PDT 2018


tkrupa marked 3 inline comments as done.
tkrupa added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:7897
+  Value *MaxVec = CGF.Builder.CreateVectorSplat(NumElements, Max);
+  Value *ExtMaxVec = Signed ? CGF.Builder.CreateSExt(MaxVec, ExtType)
+                            : CGF.Builder.CreateZExt(MaxVec, ExtType);
----------------
craig.topper wrote:
> Can we just create the constant in the extended type?
We can't - SignedMaxValue is created in non-extended type and llvm::ConstantInt::get makes an assertion that the input is of the same type. We can perform sext() on SignedMaxValue but the result will be the same.


Repository:
  rC Clang

https://reviews.llvm.org/D44786





More information about the cfe-commits mailing list