projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c6fa574
)
[SelectionDAG] Use std::clamp (NFC)
author
Kazu Hirata
<kazu@google.com>
Mon, 24 Oct 2022 07:23:51 +0000
(
00:23
-0700)
committer
Kazu Hirata
<kazu@google.com>
Mon, 24 Oct 2022 07:23:51 +0000
(
00:23
-0700)
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 8967dab250db1fb92023179f385ac7299c9c02e2..8fa4c85d5f3ad272a64d35db97f644d699f319a8 100644
(file)
--- a/
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@
-4299,7
+4299,7
@@
unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
// If the sign portion ends in our element the subtraction gives correct
// result. Otherwise it gives either negative or > bitwidth result
- return std::
max(std::min(KnownSign - rIndex * BitWidth, BitWidth), 0
);
+ return std::
clamp(KnownSign - rIndex * BitWidth, 0, BitWidth
);
}
case ISD::INSERT_VECTOR_ELT: {
// If we know the element index, split the demand between the