[PATCH] D96083: [LTT] Don't attempt to lower type tests used only by assumes

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 11:14:08 PST 2021


pcc added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:2068
+      bool OnlyAssumeUses = !CI->use_empty();
+      for (auto CIU = CI->use_begin(), CIUE = CI->use_end(); CIU != CIUE;) {
+        if (auto *AssumeCI = dyn_cast<CallInst>((*CIU++).getUser())) {
----------------
You can use a standard range for loop. We aren't rewriting users so you don't need this pattern here.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:2069
+      for (auto CIU = CI->use_begin(), CIUE = CI->use_end(); CIU != CIUE;) {
+        if (auto *AssumeCI = dyn_cast<CallInst>((*CIU++).getUser())) {
+          Function *F = AssumeCI->getCalledFunction();
----------------
You can dyn_cast to IntrinsicInst to reduce the amount of boilerplate here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96083



More information about the llvm-commits mailing list