[PATCH] D29896: [BypassSlowDivision] Refactor fast division insertion logic (NFC)

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 16:29:34 PST 2017


jlebar added inline comments.


================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:80
+  unsigned Opcode;
+  Instruction *SlowDiv;
+  IntegerType *SlowType;
----------------
This is actually SlowInstr or InstrToReplace or SlowDivOrRem -- we should be careful here and elsewhere not to call things divs that may be rems.


================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:92
+  Value *LongQuotientV;
+  Value *LongRemainderV;
+
----------------
I would feel a lot more comfortable if our constructor initialized all of these variables.  Otherwise it seems like we're asking for trouble.


================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:98
+                            BasicBlock *PhiBB, DivCacheTy &PerBBDivCache);
+  Value *createDivRunTimeCheck();
+
----------------
"Runtime" as in "runtime check" is usually one word.


https://reviews.llvm.org/D29896





More information about the llvm-commits mailing list