[PATCH] D72309: Rework be15dfa88fb1 such that it works with GlobalISel which doesn't use EVT
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 18:42:59 PST 2020
dsanders updated this revision to Diff 236489.
dsanders added a comment.
Corrected patch
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72309/new/
https://reviews.llvm.org/D72309
Files:
llvm/include/llvm/CodeGen/ISDOpcodes.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -356,10 +356,9 @@
(OldG << 2)); // New L bit.
}
-ISD::CondCode ISD::getSetCCInverse(ISD::CondCode Op, EVT Type) {
- bool IsInteger = Type.isInteger();
+static ISD::CondCode getSetCCInverseImpl(ISD::CondCode Op, bool isInteger) {
unsigned Operation = Op;
- if (IsInteger)
+ if (isInteger)
Operation ^= 7; // Flip L, G, E bits, but not U.
else
Operation ^= 15; // Flip all of the condition bits.
@@ -370,6 +369,15 @@
return ISD::CondCode(Operation);
}
+ISD::CondCode ISD::getSetCCInverse(ISD::CondCode Op, EVT Type) {
+ return getSetCCInverseImpl(Op, Type.isInteger());
+}
+
+ISD::CondCode ISD::GlobalISel::getSetCCInverse(ISD::CondCode Op,
+ bool isInteger) {
+ return getSetCCInverseImpl(Op, isInteger);
+}
+
/// For an integer comparison, return 1 if the comparison is a signed operation
/// and 2 if the result is an unsigned comparison. Return zero if the operation
/// does not depend on the sign of the input (setne and seteq).
Index: llvm/include/llvm/CodeGen/ISDOpcodes.h
===================================================================
--- llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -1099,6 +1099,12 @@
/// SetCC operation.
CondCode getSetCCInverse(CondCode Operation, EVT Type);
+ namespace GlobalISel {
+ /// Return the operation corresponding to !(X op Y), where 'op' is a valid
+ /// SetCC operation.
+ CondCode getSetCCInverse(CondCode Operation, bool isInteger);
+ } // end namespace GlobalISel
+
/// Return the operation corresponding to (Y op X) when given the operation
/// for (X op Y).
CondCode getSetCCSwappedOperands(CondCode Operation);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72309.236489.patch
Type: text/x-patch
Size: 1971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200107/080d7261/attachment.bin>
More information about the llvm-commits
mailing list