[PATCH] D127835: [SCEV] recognize llvm.annotation intrinsic

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 01:40:17 PDT 2022


shchenz created this revision.
shchenz added reviewers: nikic, lebedev.ri, spatel, reames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
shchenz requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We use this intrinsic in our codes. With this intrinsic, the consecutive store can not be recognized in SLP vectorizer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127835

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/annotation-intrinsics.ll


Index: llvm/test/Analysis/ScalarEvolution/annotation-intrinsics.ll
===================================================================
--- llvm/test/Analysis/ScalarEvolution/annotation-intrinsics.ll
+++ llvm/test/Analysis/ScalarEvolution/annotation-intrinsics.ll
@@ -7,7 +7,7 @@
 ; CHECK-LABEL: 'annotatioin'
 ; CHECK-NEXT:  Classifying expressions for: @annotatioin
 ; CHECK-NEXT:    %1 = tail call i64 @llvm.annotation.i64(i64 %x, i8* null, i8* null, i32 0)
-; CHECK-NEXT:    --> %1 U: full-set S: full-set
+; CHECK-NEXT:    --> %x U: full-set S: full-set
 ; CHECK-NEXT:  Determining loop execution counts for: @annotatioin
 ;
   %1 = tail call i64 @llvm.annotation.i64(i64 %x, i8* null, i8* null, i32 0)
Index: llvm/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolution.cpp
+++ llvm/lib/Analysis/ScalarEvolution.cpp
@@ -7625,8 +7625,9 @@
         return getAddExpr(ClampedX, Y, SCEV::FlagNUW);
       }
       case Intrinsic::start_loop_iterations:
-        // A start_loop_iterations is just equivalent to the first operand for
-        // SCEV purposes.
+      case Intrinsic::annotation:
+        // A start_loop_iterations or llvm.annotation is just equivalent to the
+        // first operand for SCEV purposes.
         return getSCEV(II->getArgOperand(0));
       default:
         break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127835.437079.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220615/4f0d5409/attachment.bin>


More information about the llvm-commits mailing list