[PATCH] D31189: [InstCombine] Fix folding of select into phi nodes when incoming element of phi is a vector type
Anna Thomas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 24 13:45:59 PDT 2017
anna added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:915
+ // `TrueVInPred`.
+ if (InC && !isa<ConstantExpr>(InC) && !isa<VectorType>(InC->getType()))
InV = InC->isNullValue() ? FalseVInPred : TrueVInPred;
----------------
sanjoy wrote:
> Actually, one more thing -- can we rewrite this as a positive test? That is, instead of checking what `Inc` cannot be, check that it is only allowed to be a `ConstantInt`?
>
> (I'm fine doing that cleanup as a follow-on change.)
Will do.
================
Comment at: test/Transforms/InstCombine/phi-select-constexpr.ll:1
; RUN: opt < %s -S -instcombine | FileCheck %s
@A = extern_weak global i32, align 4
----------------
sanjoy wrote:
> Should we rename this file now?
Maybe something like `phi-select-const`?
https://reviews.llvm.org/D31189
More information about the llvm-commits
mailing list