[PATCH] D11503: [INSTCOMBINE][X86][SSE] Replace sign/zero extension intrinsics with native IR

Sanjay Patel spatel at rotateright.com
Sat Jul 25 09:23:22 PDT 2015

spatel added subscribers: ab, probinson, echristo.
spatel added a comment.

LGTM; see inline comments for nits.

But as Paul suggested recently, we should decide how to handle these in general since we have a mishmash of implementations...
Then start the drudge work of fixing the hundreds of intrinsics that we decide are done wrong. :(

https://llvm.org/bugs/show_bug.cgi?id=24125 and related bugs

Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:208
@@ +207,3 @@
+  // Extract a subvector of the first NumElts lanes and sign extend.
+  SmallVector<int, 8> ShuffleMask;
Remove 'sign' from comment since this is a general extend now?

Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:215-217
@@ +214,5 @@
+                                          UndefValue::get(SrcTy), ShuffleMask);
+  Value *EX = SignExtend ? Builder.CreateSExt(SV, DstTy)
+                         : Builder.CreateZExt(SV, DstTy);
+  return EX;
Can fold these 2 lines together; no need for EX temp.



More information about the llvm-commits mailing list