diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-13 01:05:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-13 01:05:56 +0000 |
commit | 9056bae3be212b0a71dafab1bf282ffff947ebc5 (patch) | |
tree | 8d48b2fb837cddbd511fce8f3e850e7ee0fb2ce5 /llvm/lib | |
parent | 72df49f5069b0ba46ee6d562c5d5f58da1165ba0 (diff) | |
download | bcm5719-llvm-9056bae3be212b0a71dafab1bf282ffff947ebc5.tar.gz bcm5719-llvm-9056bae3be212b0a71dafab1bf282ffff947ebc5.zip |
Fix switch lowering to order cases in zext order, which is how we emit the
comparisons. This fixes an infinite loop on CodeGen/Generic/switch-lower.ll
and PR1197
llvm-svn: 34216
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 16d25ee2259..0dd762e58d2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -389,8 +389,8 @@ class SelectionDAGLowering { struct CaseCmp { bool operator () (const Case& C1, const Case& C2) { assert(isa<ConstantInt>(C1.first) && isa<ConstantInt>(C2.first)); - return cast<const ConstantInt>(C1.first)->getSExtValue() < - cast<const ConstantInt>(C2.first)->getSExtValue(); + return cast<const ConstantInt>(C1.first)->getZExtValue() < + cast<const ConstantInt>(C2.first)->getZExtValue(); } }; |