summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-08-15 14:19:22 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-08-15 14:19:22 +0000
commit85af131d9e76e57244c8704792647f173443ffb6 (patch)
tree0eed32284a1a2ce3eef7ffcab00c529d75c970c4 /lib
parentce08e1dd3ed5427f4efee4a8efe4b4b544efa2e3 (diff)
downloadexternal_llvm-85af131d9e76e57244c8704792647f173443ffb6.zip
external_llvm-85af131d9e76e57244c8704792647f173443ffb6.tar.gz
external_llvm-85af131d9e76e57244c8704792647f173443ffb6.tar.bz2
Unary Not (boolean and bitwise) is no longer a separate LLVM instruction
but is instead implemented with XOR. Note that the InstrForest opLabels for Not and BNot remain the same, i.e., the XOR is recognized and represented as a (boolean or bitwise) Not when building the instruction trees. But these tree nodes are now binary, not unary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3343 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/InstrSelection/InstrForest.cpp9
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrForest.cpp9
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrForest.cpp b/lib/CodeGen/InstrSelection/InstrForest.cpp
index d7edf15..c24c35b 100644
--- a/lib/CodeGen/InstrSelection/InstrForest.cpp
+++ b/lib/CodeGen/InstrSelection/InstrForest.cpp
@@ -73,10 +73,15 @@ InstructionNode::InstructionNode(Instruction* I)
{
opLabel = opLabel + 100; // load/getElem with index vector
}
+ else if (opLabel == Instruction::Xor &&
+ BinaryOperator::isNot(I))
+ {
+ opLabel = (I->getType() == Type::BoolTy)? NotOp // boolean Not operator
+ : BNotOp; // bitwise Not operator
+ }
else if (opLabel == Instruction::And ||
opLabel == Instruction::Or ||
- opLabel == Instruction::Xor ||
- opLabel == Instruction::Not)
+ opLabel == Instruction::Xor)
{
// Distinguish bitwise operators from logical operators!
if (I->getType() != Type::BoolTy)
diff --git a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
index d7edf15..c24c35b 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
@@ -73,10 +73,15 @@ InstructionNode::InstructionNode(Instruction* I)
{
opLabel = opLabel + 100; // load/getElem with index vector
}
+ else if (opLabel == Instruction::Xor &&
+ BinaryOperator::isNot(I))
+ {
+ opLabel = (I->getType() == Type::BoolTy)? NotOp // boolean Not operator
+ : BNotOp; // bitwise Not operator
+ }
else if (opLabel == Instruction::And ||
opLabel == Instruction::Or ||
- opLabel == Instruction::Xor ||
- opLabel == Instruction::Not)
+ opLabel == Instruction::Xor)
{
// Distinguish bitwise operators from logical operators!
if (I->getType() != Type::BoolTy)