[PATCH] D47951: [SCEV] Look through zero-extends in howFarToZero

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 13:35:58 PDT 2018


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: lib/Analysis/ScalarEvolution.cpp:8153
 
+const SCEV *ScalarEvolution::stripInjectiveFunctions(const SCEV *Val) const {
+  if (const SCEVZeroExtendExpr *ZExt = dyn_cast<SCEVZeroExtendExpr>(Val))
----------------
General convention is to use `S` for `SCEV*` variables, not `Val`.


================
Comment at: test/Analysis/ScalarEvolution/strip-injective-zext.ll:18
+
+define dso_local i32 @f0(i32 %a0, i32 %a1, %s.0* nocapture %a2) local_unnamed_addr #0 {
+b0:
----------------
Minor: the test can probably be simplified a little bit more:

 - Use an i64 pointer instead of the `%s.0` pointer
 - Strip unnecessary function attributes like `dso_local`, `local_unnamed_addr`, TBAA etc.


Repository:
  rL LLVM

https://reviews.llvm.org/D47951





More information about the llvm-commits mailing list