[PATCH] D37198: [InlineCost] add visitSelectInst()

Haicheng Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 11:37:40 PDT 2017


haicheng added a comment.

Thank you, Chandler.  I will update the patch shortly.



================
Comment at: lib/Analysis/InlineCost.cpp:1201
+    // Select True, X, Y => X
+    if (CondC->isAllOnesValue() && TrueC) {
+      SimplifiedValues[&SI] = TrueC;
----------------
chandlerc wrote:
> No need to separately test for true and false once you know the condition is a constant. Just check `isNullValue()`. It's either false, or true. =]
The vector constant condition can be <i1 true, i1 false>.  It is neither AllOnesValue or NullValue.


Repository:
  rL LLVM

https://reviews.llvm.org/D37198





More information about the llvm-commits mailing list