summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-10-07 15:18:30 +0000
committerSanjay Patel <spatel@rotateright.com>2018-10-07 15:18:30 +0000
commit46a9dc2e3e2c687a43abbed253d0298fbcc67baa (patch)
treeb199cac1869ae516787df651075feb441df3eaa4 /llvm/lib/CodeGen/SelectionDAG
parent31a3f2aabaf832bca14ecfe6c409ca0618681ffc (diff)
downloadbcm5719-llvm-46a9dc2e3e2c687a43abbed253d0298fbcc67baa.tar.gz
bcm5719-llvm-46a9dc2e3e2c687a43abbed253d0298fbcc67baa.zip
[DAGCombiner] shorten code for bitcast+fabs fold; NFC
llvm-svn: 343939
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index ec7f63a3d3f..c91aa83b421 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12162,11 +12162,8 @@ SDValue DAGCombiner::visitFABS(SDNode *N) {
if (N0.getOpcode() == ISD::FNEG || N0.getOpcode() == ISD::FCOPYSIGN)
return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0.getOperand(0));
- // Transform fabs(bitconvert(x)) -> bitconvert(x & ~sign) to avoid loading
- // constant pool values.
- if (!TLI.isFAbsFree(VT) &&
- N0.getOpcode() == ISD::BITCAST &&
- N0.getNode()->hasOneUse()) {
+ // fabs(bitcast(x)) -> bitcast(x & ~sign) to avoid constant pool loads.
+ if (!TLI.isFAbsFree(VT) && N0.getOpcode() == ISD::BITCAST && N0.hasOneUse()) {
SDValue Int = N0.getOperand(0);
EVT IntVT = Int.getValueType();
if (IntVT.isInteger() && !IntVT.isVector()) {
OpenPOWER on IntegriCloud