[PATCH] D48067: [InstCombine] Replacing X86-specific rounding intrinsics with generic floor-ceil

Mikhail Dvoretckii via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 04:26:49 PDT 2018


mike.dvoretsky added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:586
+      IntrinsicID == Intrinsic::x86_sse41_round_sd)
+    RoundControl = cast<ConstantInt>(II.getArgOperand(2))->getSExtValue();
+  else if (IntrinsicID == Intrinsic::x86_avx512_mask_rndscale_ss ||
----------------
craig.topper wrote:
> Not sure if we should assume the rounding mode or SAE is a constant int. The clang frontend guarantees it, but handcrafted IR tests could break it.
Rounding and SAE are immediate. Not using constants here leads to isel failure. Not sure this code should accept such explicitly incorrect cases.


https://reviews.llvm.org/D48067





More information about the llvm-commits mailing list