[PATCH] D49837: [SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 12 05:08:35 PDT 2018
RKSimon added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2596
+ SDValue Shift = DAG.getNode(ISD::SRA, dl, VT, Op,
+ DAG.getConstant(VT.getSizeInBits() - 1, dl, VT));
+ SDValue Add = DAG.getNode(ISD::ADD, dl, VT, Op, Shift);
----------------
Safer to use getScalaraSizeInBits - in case vector types ever use this.
Repository:
rL LLVM
https://reviews.llvm.org/D49837
More information about the llvm-commits
mailing list