llvm.org GIT mirror
Merging r168186: into the 3.2 release branch. InstructionSimplify should be able to simplify A+B==B+A to 'true' but wasn't due to the same logic bug that caused PR14361. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168593 91177308-0d34-0410-b5e6-96231b3b80d8 Pawel Wodnicki 8 years ago
2 changed file(s) with 23 addition(s) and 2 deletion(s).
 2064 2064 if (A && C && (A == C || A == D || B == C || B == D) && 2065 2065 NoLHSWrapProblem && NoRHSWrapProblem) { 2066 2066 // Determine Y and Z in the form icmp (X+Y), (X+Z). 2067 Value *Y = (A == C || A == D) ? B : A; 2068 Value *Z = (C == A || C == B) ? D : C;⏎ 2067 Value *Y, *Z;⏎ 2068 if (A == C) { 2069 Y = B; 2070 Z = D; 2071 } else if (A == D) { 2072 Y = B; 2073 Z = C; 2074 } else if (B == C) { 2075 Y = A; 2076 Z = D; 2077 } else if (B == D) { 2078 Y = A; 2079 Z = C; 2080 } 2069 2081 if (Value *V = SimplifyICmpInst(Pred, Y, Z, Q, MaxRecurse-1)) 2070 2082 return V; 2071 2083 }
 265 265 ; CHECK: ret i1 true 266 266 } 267 267 268 define i1 @add6(i64 %A, i64 %B) { 269 ; CHECK: @add6 270 %s1 = add i64 %A, %B 271 %s2 = add i64 %B, %A 272 %cmp = icmp eq i64 %s1, %s2 273 ret i1 %cmp 274 ; CHECK: ret i1 true 275 } 276 268 277 define i1 @addpowtwo(i32 %x, i32 %y) { 269 278 ; CHECK: @addpowtwo 270 279 %l = lshr i32 %x, 1