[PATCH] D38369: [InstSimplify] teach SimplifySelectInst() to fold more vector selects
Haicheng Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 29 12:34:32 PDT 2017
haicheng added inline comments.
================
Comment at: lib/Analysis/InstructionSimplify.cpp:3585
+ if (Constant *CF = dyn_cast<Constant>(FalseVal))
+ return ConstantExpr::getSelect(CB, CT, CF);
if (CB->isAllOnesValue())
----------------
spatel wrote:
> I think we should use ConstantFoldSelectInstruction() here (to be more efficient?). That's the interface for other opcodes from what I can see in other parts of the file.
I think I cannot use ConstantFoldSelectInstruction() which is declared in IR/ConstantFold.h rather than llvm/Analysis/ConstantFolding.h. From the comments in IR/ConstantFold.h, ConstantFoldSelectInstruction() is used internal to ConstantExpr::get* methods.
Many ConstantFoldxxx methods used in this file are declared in llvm/Analysis/ConstantFolding.h. I also find several places in this file calling ConstantExpr::get* methods.
Repository:
rL LLVM
https://reviews.llvm.org/D38369
More information about the llvm-commits
mailing list