[llvm-commits] [llvm] r51112 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/pr2326.ll
Dan Gohman
gohman at apple.com
Wed May 14 11:17:09 PDT 2008
Author: djg
Date: Wed May 14 13:17:09 2008
New Revision: 51112
URL: http://llvm.org/viewvc/llvm-project?rev=51112&view=rev
Log:
When bit-twiddling CondCode values for integer comparisons produces
SETOEQ, is it does with (SETEQ & SETULE), map it to SETEQ.
Added:
llvm/trunk/test/CodeGen/X86/pr2326.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=51112&r1=51111&r2=51112&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed May 14 13:17:09 2008
@@ -293,6 +293,7 @@
switch (Result) {
default: break;
case ISD::SETUO : Result = ISD::SETFALSE; break; // SETUGT & SETULT
+ case ISD::SETOEQ: // SETEQ & SETU[LG]E
case ISD::SETUEQ: Result = ISD::SETEQ ; break; // SETUGE & SETULE
case ISD::SETOLT: Result = ISD::SETULT ; break; // SETULT & SETNE
case ISD::SETOGT: Result = ISD::SETUGT ; break; // SETUGT & SETNE
Added: llvm/trunk/test/CodeGen/X86/pr2326.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2326.ll?rev=51112&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pr2326.ll (added)
+++ llvm/trunk/test/CodeGen/X86/pr2326.ll Wed May 14 13:17:09 2008
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep sete
+; PR2326
+
+define i32 @func_59(i32 %p_60) nounwind {
+entry:
+ %l_108 = alloca i32 ; <i32*> [#uses=2]
+ %tmp15 = load i32* null, align 4 ; <i32> [#uses=1]
+ %tmp16 = load i32* %l_108, align 4 ; <i32> [#uses=1]
+ %tmp17 = icmp eq i32 %tmp15, %tmp16 ; <i1> [#uses=1]
+ %tmp1718 = zext i1 %tmp17 to i8 ; <i8> [#uses=1]
+ %tmp19 = load i32* null, align 4 ; <i32> [#uses=1]
+ %tmp20 = load i32* %l_108, align 4 ; <i32> [#uses=1]
+ %tmp21 = icmp ule i32 %tmp19, %tmp20 ; <i1> [#uses=1]
+ %tmp2122 = zext i1 %tmp21 to i8 ; <i8> [#uses=1]
+ %toBool23 = icmp ne i8 %tmp1718, 0 ; <i1> [#uses=1]
+ %toBool24 = icmp ne i8 %tmp2122, 0 ; <i1> [#uses=1]
+ %tmp25 = and i1 %toBool23, %toBool24 ; <i1> [#uses=1]
+ %tmp2526 = zext i1 %tmp25 to i8 ; <i8> [#uses=1]
+ %tmp252627 = zext i8 %tmp2526 to i32 ; <i32> [#uses=1]
+ %tmp29 = call i32 (...)* @func_15( i32 %tmp252627, i32 0 ) nounwind ; <i32> [#uses=0]
+ unreachable
+}
+
+declare i32 @func_15(...)
More information about the llvm-commits
mailing list