[PATCH] D12139: Add 'strlen' formation to LoopIdiomRecognize

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 00:29:26 PDT 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1081
@@ +1080,3 @@
+    }
+    switch (Inst->getOpcode()) {
+    case Instruction::Add:
----------------
Do you also need to skip debug intrinsics, etc.?

================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1119
@@ +1118,3 @@
+    if (VectorType *VTy = dyn_cast<VectorType>(IndVar->getType()))
+      StrLenV = Builder.CreateVectorSplat(VTy->getNumElements(), StrLenV);
+    Value *Result = Builder.CreateAdd(Start, Builder.CreateMul(Step, StrLenV));
----------------
Can you please add a test case for this variant with vectors?



Repository:
  rL LLVM

http://reviews.llvm.org/D12139





More information about the llvm-commits mailing list