[PATCH] Select Elimination in InstCombine

Chad Rosier mcrosier at codeaurora.org
Tue Sep 9 05:24:13 PDT 2014


================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:1
@@ +1,2 @@
+; Checks if select is replaced by or in select - cmp [eq|ne] - br sequence
+; RUN: opt -instcombine -S < %s | FileCheck %s
----------------
Perhaps something like:
; Replace a 'select' with an 'or' in a 'select - cmp[eq|ne] - br' sequence when profitable.

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:9
@@ +8,3 @@
+
+define void @foo(%C*) {
+entry:
----------------
@test1

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:10
@@ +9,3 @@
+define void @foo(%C*) {
+entry:
+  %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0
----------------
CHECK-LABEL: @test1

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:36
@@ +35,3 @@
+  br label %9
+}
+define void @foo1(%C*) {
----------------
insert newline

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:37
@@ +36,3 @@
+}
+define void @foo1(%C*) {
+entry:
----------------
@test2

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:38
@@ +37,3 @@
+define void @foo1(%C*) {
+entry:
+  %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0
----------------
CHECK-LABEL: @test2

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:64
@@ +63,3 @@
+  br label %9
+}
+define void @foo2(%C*) {
----------------
newline

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:65
@@ +64,3 @@
+}
+define void @foo2(%C*) {
+entry:
----------------
@test3

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:67
@@ +66,3 @@
+entry:
+  %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0
+  %m = load i64** %1, align 8
----------------
CHECK-LABEL: @test3

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:92
@@ +91,3 @@
+  br label %9
+}
+define void @foo3(%C*) {
----------------
newline

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:93
@@ +92,3 @@
+}
+define void @foo3(%C*) {
+entry:
----------------
@test4

================
Comment at: test/Transforms/InstCombine/select-cmp-br.ll:94
@@ +93,3 @@
+define void @foo3(%C*) {
+entry:
+  %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0
----------------
CHECK-LABEL: @test4

http://reviews.llvm.org/D5258






More information about the llvm-commits mailing list