[PATCH] D71435: [WIP] [Attributor] Function level undefined behavior attribute

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 11:34:03 PST 2019


jdoerfert added a comment.

You should either diff against the proper trunk revision you work on or merge all your commits into a single one. Right now you always only upload a diff against the last version of the patch.



================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:1973
 
+  std::unordered_set<Instruction*> noUBLoads;
+
----------------
I would have taken a `SmallPtrSet<Instruction *, 8>`.

Please start variable names with an upper case letter.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:1994
+          noUBLoads.insert(I);
+        }
+      }
----------------
FWIW: Branching on an uninitialized local variable is UB.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2001
+      return ChangeStatus::CHANGED;
+    }
+    return ChangeStatus::UNCHANGED;
----------------
Nit: Cant -> Cannot

No braces if there is only a single stmt.


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

https://reviews.llvm.org/D71435





More information about the llvm-commits mailing list