mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[DAGCombiner] shorten code for bitcast+fabs fold; NFC
llvm-svn: 343939
This commit is contained in:
parent
cf56d6ee4c
commit
1dbe3542e9
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user