Skip to content

Commit

Permalink
[InstCombine] update datalayout in test file; NFC
Browse files Browse the repository at this point in the history
We need to specify legal integer widths to trigger PR46712,
so add those here. This doesn't appear to affect any existing
tests, and it's not clear why a datalayout would not include
any legal integer widths.

While here, change some variable names that include 'tmp' to
avoid warnings from the auto-generating script for CHECK lines.

(cherry picked from commit efc30e5)
  • Loading branch information
rotateright authored and zmodem committed Jul 16, 2020
1 parent 73e8ca7 commit 59521a0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions llvm/test/Transforms/InstCombine/or.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n32:64"

define i32 @test12(i32 %A) {
; Should be eliminated
Expand Down Expand Up @@ -107,17 +107,17 @@ define i32 @test20(i32 %x) {
ret i32 %z
}

define i32 @test21(i32 %tmp.1) {
define i32 @test21(i32 %t1) {
; CHECK-LABEL: @test21(
; CHECK-NEXT: [[TMP_1_MASK1:%.*]] = add i32 [[TMP_1:%.*]], 2
; CHECK-NEXT: ret i32 [[TMP_1_MASK1]]
; CHECK-NEXT: [[T1_MASK1:%.*]] = add i32 [[T1:%.*]], 2
; CHECK-NEXT: ret i32 [[T1_MASK1]]
;
%tmp.1.mask1 = add i32 %tmp.1, 2
%tmp.3 = and i32 %tmp.1.mask1, -2
%tmp.5 = and i32 %tmp.1, 1
%t1.mask1 = add i32 %t1, 2
%t3 = and i32 %t1.mask1, -2
%t5 = and i32 %t1, 1
;; add tmp.1, 2
%tmp.6 = or i32 %tmp.5, %tmp.3
ret i32 %tmp.6
%t6 = or i32 %t5, %t3
ret i32 %t6
}

define i32 @test22(i32 %B) {
Expand Down

0 comments on commit 59521a0

Please sign in to comment.