[PATCH] [InstCombine][X86] Improved folding of calls to Intrinsic::x86_sse4a_insertqi.

Quentin Colombet qcolombet at apple.com
Tue Dec 9 18:08:47 PST 2014


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:784
@@ +783,3 @@
+        // results are undefined.
+        if ((Index + Length) > 64)
+          return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
----------------
majnemer wrote:
> Is there anything that prevents `Index + Length` from wrapping around? If not, what happens?
I think there is nothing that would prevent that, but in that case we fall into this condition:
"If the sum of the bit index + length field is greater than 64, the results are undefined.”

So I’d say nothing to be done here but maybe I misunderstood something :).

http://reviews.llvm.org/D6583






More information about the llvm-commits mailing list