Skip to content

Commit f7d94b7

Browse files
committed
[SelectionDAG] Use getAllOnesConstant.
1 parent 69f76c7 commit f7d94b7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5042,7 +5042,8 @@ void SelectionDAGLegalize::ConvertNodeToLibcall(SDNode *Node) {
50425042
case ISD::RESET_FPENV: {
50435043
// It is legalized to call 'fesetenv(FE_DFL_ENV)'. On most targets
50445044
// FE_DFL_ENV is defined as '((const fenv_t *) -1)' in glibc.
5045-
SDValue Ptr = DAG.getIntPtrConstant(-1LL, dl);
5045+
EVT PtrTy = TLI.getPointerTy(DAG.getDataLayout());
5046+
SDValue Ptr = DAG.getAllOnesConstant(dl, PtrTy);
50465047
SDValue Chain = Node->getOperand(0);
50475048
Results.push_back(
50485049
DAG.makeStateFunctionCall(RTLIB::FESETENV, Ptr, Chain, dl));
@@ -5097,7 +5098,7 @@ void SelectionDAGLegalize::ConvertNodeToLibcall(SDNode *Node) {
50975098
// target must provide custom lowering.
50985099
const DataLayout &DL = DAG.getDataLayout();
50995100
EVT PtrTy = TLI.getPointerTy(DL);
5100-
SDValue Mode = DAG.getConstant(-1LL, dl, PtrTy);
5101+
SDValue Mode = DAG.getAllOnesConstant(dl, PtrTy);
51015102
Results.push_back(DAG.makeStateFunctionCall(RTLIB::FESETMODE, Mode,
51025103
Node->getOperand(0), dl));
51035104
break;

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10658,7 +10658,7 @@ SDValue TargetLowering::expandCMP(SDNode *Node, SelectionDAG &DAG) const {
1065810658
SDValue SelectZeroOrOne =
1065910659
DAG.getSelect(dl, ResVT, IsGT, DAG.getConstant(1, dl, ResVT),
1066010660
DAG.getConstant(0, dl, ResVT));
10661-
return DAG.getSelect(dl, ResVT, IsLT, DAG.getConstant(-1, dl, ResVT),
10661+
return DAG.getSelect(dl, ResVT, IsLT, DAG.getAllOnesConstant(dl, ResVT),
1066210662
SelectZeroOrOne);
1066310663
}
1066410664

0 commit comments

Comments
 (0)