diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-03-05 22:46:48 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-03-05 22:46:48 +0000 |
commit | 62a4f5c2129917811b1aa6d64e623d946524c4c7 (patch) | |
tree | f9024db90364ef50f835a9dcff74671c48426be7 /llvm/lib/Analysis/InstructionSimplify.cpp | |
parent | 2bc42e90ed147c45a1f0c74b61bb9f6176dbb9ef (diff) | |
download | bcm5719-llvm-62a4f5c2129917811b1aa6d64e623d946524c4c7.tar.gz bcm5719-llvm-62a4f5c2129917811b1aa6d64e623d946524c4c7.zip |
[InstSimplify] remove redundant folds
The 'hasOneUse' check is a giveaway that something's not right.
We never need to check that in InstSimplify because we don't
create new instructions here.
These are all handled as icmp simplifies which then trigger
existing select simplifies, so there's no need to duplicate
a composite fold of the two.
llvm-svn: 326750
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 40ed69a5588..8b8a0417aa6 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -3624,24 +3624,6 @@ static Value *simplifySelectWithICmpCond(Value *CondVal, Value *TrueVal, TrueVal, FalseVal)) return V; - if (CondVal->hasOneUse()) { - const APInt *C; - if (match(CmpRHS, m_APInt(C))) { - // X < MIN ? T : F --> F - if (Pred == ICmpInst::ICMP_SLT && C->isMinSignedValue()) - return FalseVal; - // X < MIN ? T : F --> F - if (Pred == ICmpInst::ICMP_ULT && C->isMinValue()) - return FalseVal; - // X > MAX ? T : F --> F - if (Pred == ICmpInst::ICMP_SGT && C->isMaxSignedValue()) - return FalseVal; - // X > MAX ? T : F --> F - if (Pred == ICmpInst::ICMP_UGT && C->isMaxValue()) - return FalseVal; - } - } - // If we have an equality comparison, then we know the value in one of the // arms of the select. See if substituting this value into the arm and // simplifying the result yields the same value as the other arm. |