[llvm] 0877843 - [test] Make data layout of load-bitcast64.ll explicit, use update_test_checks.py
Juneyoung Lee via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 09:50:05 PST 2020
Author: Juneyoung Lee
Date: 2020-01-15T02:49:44+09:00
New Revision: 0877843ddacca0bea049b65d8a328e5038c72b66
URL: https://github.com/llvm/llvm-project/commit/0877843ddacca0bea049b65d8a328e5038c72b66
DIFF: https://github.com/llvm/llvm-project/commit/0877843ddacca0bea049b65d8a328e5038c72b66.diff
LOG: [test] Make data layout of load-bitcast64.ll explicit, use update_test_checks.py
Added:
Modified:
llvm/test/Transforms/InstCombine/load-bitcast64.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/load-bitcast64.ll b/llvm/test/Transforms/InstCombine/load-bitcast64.ll
index d14c686d83ea..58bc923da699 100644
--- a/llvm/test/Transforms/InstCombine/load-bitcast64.ll
+++ b/llvm/test/Transforms/InstCombine/load-bitcast64.ll
@@ -1,13 +1,17 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -instcombine -S < %s | FileCheck %s
-target datalayout = "p:64:64:64"
+target datalayout = "p:64:64:64-i64:32:32"
define i64* @test1(i8* %x) {
-entry:
; CHECK-LABEL: @test1(
-; CHECK: load i64*, i64**
-; CHECK: ret
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[X:%.*]] to i64**
+; CHECK-NEXT: [[B1:%.*]] = load i64*, i64** [[TMP0]], align 8
+; CHECK-NEXT: ret i64* [[B1]]
+;
+entry:
%a = bitcast i8* %x to i64*
%b = load i64, i64* %a
%c = inttoptr i64 %b to i64*
@@ -16,10 +20,15 @@ entry:
}
define i32* @test2(i8* %x) {
-entry:
; CHECK-LABEL: @test2(
-; CHECK: load i32, i32*
-; CHECK: ret
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[A:%.*]] = bitcast i8* [[X:%.*]] to i32*
+; CHECK-NEXT: [[B:%.*]] = load i32, i32* [[A]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[B]] to i64
+; CHECK-NEXT: [[C:%.*]] = inttoptr i64 [[TMP0]] to i32*
+; CHECK-NEXT: ret i32* [[C]]
+;
+entry:
%a = bitcast i8* %x to i32*
%b = load i32, i32* %a
%c = inttoptr i32 %b to i32*
@@ -28,10 +37,15 @@ entry:
}
define i64* @test3(i8* %x) {
-entry:
; CHECK-LABEL: @test3(
-; CHECK: load i32, i32*
-; CHECK: ret
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[A:%.*]] = bitcast i8* [[X:%.*]] to i32*
+; CHECK-NEXT: [[B:%.*]] = load i32, i32* [[A]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[B]] to i64
+; CHECK-NEXT: [[C:%.*]] = inttoptr i64 [[TMP0]] to i64*
+; CHECK-NEXT: ret i64* [[C]]
+;
+entry:
%a = bitcast i8* %x to i32*
%b = load i32, i32* %a
%c = inttoptr i32 %b to i64*
@@ -40,10 +54,13 @@ entry:
}
define i64 @test4(i8* %x) {
-entry:
; CHECK-LABEL: @test4(
-; CHECK: load i64, i64*
-; CHECK: ret
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[X:%.*]] to i64*
+; CHECK-NEXT: [[B1:%.*]] = load i64, i64* [[TMP0]], align 4
+; CHECK-NEXT: ret i64 [[B1]]
+;
+entry:
%a = bitcast i8* %x to i64**
%b = load i64*, i64** %a
%c = ptrtoint i64* %b to i64
@@ -52,11 +69,14 @@ entry:
}
define i32 @test5(i8* %x) {
-entry:
; CHECK-LABEL: @test5(
-; CHECK: load i64, i64*
-; CHECK: trunc
-; CHECK: ret
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[X:%.*]] to i64*
+; CHECK-NEXT: [[B1:%.*]] = load i64, i64* [[TMP0]], align 8
+; CHECK-NEXT: [[C:%.*]] = trunc i64 [[B1]] to i32
+; CHECK-NEXT: ret i32 [[C]]
+;
+entry:
%a = bitcast i8* %x to i32**
%b = load i32*, i32** %a
%c = ptrtoint i32* %b to i32
@@ -65,10 +85,13 @@ entry:
}
define i64 @test6(i8* %x) {
-entry:
; CHECK-LABEL: @test6(
-; CHECK: load i64, i64*
-; CHECK: ret
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[X:%.*]] to i64*
+; CHECK-NEXT: [[B1:%.*]] = load i64, i64* [[TMP0]], align 4
+; CHECK-NEXT: ret i64 [[B1]]
+;
+entry:
%a = bitcast i8* %x to i32**
%b = load i32*, i32** %a
%c = ptrtoint i32* %b to i64
More information about the llvm-commits
mailing list