diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-05-11 21:07:09 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-05-11 21:07:09 +0000 |
commit | 5b202966f5e7dec49055fffd4b6eea005530b0bc (patch) | |
tree | 9f90cdaa1ab4fcc9d9f04f1e58910262be05230a /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | c200b5c6ea6abfb60006f6d952c393774c641530 (diff) | |
download | bcm5719-llvm-5b202966f5e7dec49055fffd4b6eea005530b0bc.tar.gz bcm5719-llvm-5b202966f5e7dec49055fffd4b6eea005530b0bc.zip |
propagate IR-level fast-math-flags to DAG nodes; 2nd try; NFC
This is a less ambitious version of:
http://reviews.llvm.org/rL236546
because that was reverted in:
http://reviews.llvm.org/rL236600
because it caused memory corruption that wasn't related to FMF
but was actually due to making nodes with 2 operands derive from a
plain SDNode rather than a BinarySDNode.
This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997
...which split the existing nsw / nuw / exact flags and FMF
into their own struct.
llvm-svn: 237046
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 38e39e52e81..70d04c02580 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2660,8 +2660,9 @@ SDValue TargetLowering::BuildExactSDIV(SDValue Op1, SDValue Op2, SDLoc dl, // TODO: For UDIV use SRL instead of SRA. SDValue Amt = DAG.getConstant(ShAmt, dl, getShiftAmountTy(Op1.getValueType())); - Op1 = DAG.getNode(ISD::SRA, dl, Op1.getValueType(), Op1, Amt, false, false, - true); + SDNodeFlags Flags; + Flags.setExact(true); + Op1 = DAG.getNode(ISD::SRA, dl, Op1.getValueType(), Op1, Amt, &Flags); d = d.ashr(ShAmt); } |