[PATCH] D54653: Correct CreateAlignmentAssumption to check sign and power-of-2 (LLVM Part)

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 16 20:07:10 PST 2018


hfinkel requested changes to this revision.
hfinkel added inline comments.
This revision now requires changes to proceed.


================
Comment at: include/llvm/IR/IRBuilder.h:58
+
+enum class AlignmentSign { Signed, Unsigned};
+
----------------
Why not just use a Boolean?


================
Comment at: include/llvm/IR/IRBuilder.h:2200
+
+    // Alignments are only valid if  > 0 && IsPowerOf2.
+    Value *IsPositive = CreateICmp(
----------------
True, but I don't see why we're checking it here. It's just UB.


Repository:
  rL LLVM

https://reviews.llvm.org/D54653





More information about the llvm-commits mailing list