[PATCH] D69747: [IPConstantProp][NFCI] Improve and modernize tests

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 2 13:05:57 PDT 2019


jdoerfert marked 5 inline comments as done.
jdoerfert added inline comments.


================
Comment at: llvm/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll:27
   %3 = load i8, i8* %2
-; CHECK: load i8, i8* getelementptr inbounds (%struct.MYstr, %struct.MYstr* @mystr, i32 0, i32 0)
+; CHECK: %struct.MYstr* @mystr, i{{..}} 0, i32 0
   %4 = zext i8 %3 to i32
----------------
This matches closer the check lines above and it also does not force us to fold the gep into the load (which is not what is important here).


================
Comment at: llvm/test/Transforms/IPConstantProp/PR26044.ll:62
-; CHECK:%[[COND:.*]] = select i1 %[[TOBOOL]], i32 %p1, i32 %p1
-; CHECK: ret i32 %[[COND]]
----------------
Having the check lines at the end makes it hard to relate them to code so I went with a update of all lines here.


================
Comment at: llvm/test/Transforms/IPConstantProp/arg-count-mismatch.ll:57
+  %add = add i16 %call1, %call2
+  ret i16 %add
 }
----------------
The calls were essentially dead and could be removed, make sure that is not the optimization we are looking for.


================
Comment at: llvm/test/Transforms/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll:18
   ret i32 10
 }
 
----------------
Branch on undef is UB, I think, and even if not, this method did trivially return 10 even without resolving any constant branches. Make sure this is not the case anymore and add a "for sure UB-free" path while we are at it.


================
Comment at: llvm/test/Transforms/IPConstantProp/user-with-multiple-uses.ll:33
-; CHECK: attributes #0 = { noreturn nounwind }
-; CHECK: attributes #1 = { nounwind }
----------------
These attributes are given already (and arguably wrong from a more fundamental standpoint) so it is questionable why we should check for them in the first place.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69747/new/

https://reviews.llvm.org/D69747





More information about the llvm-commits mailing list