[PATCH] D65298: [DivRemPairs] Handling for expanded-form rem - recomposition (PR42673)
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 30 02:52:03 PDT 2019
lebedev.ri added a comment.
Reduced:
$ cat zz.ll
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @d(i32 %X, i32 %Y, i32 %Z) {
bb:
%t0 = mul nsw i32 %Z, %Y
%t1 = sdiv i32 %X, %t0
%t2 = mul nsw i32 %t0, %t1
%t3 = sub nsw i32 %X, %t2
%t4 = sdiv i32 %t3, %Y
%t5 = mul nsw i32 %t4, %Y
%t6 = sub nsw i32 %t3, %t5
ret i32 %t6
}
$ /builddirs/llvm-project/build-Clang8-unknown/bin/opt -div-rem-pairs zz.ll -o - -S
Only PHI nodes may reference their own value!
%t6 = srem i32 %t6, %Y
in function d
LLVM ERROR: Broken function found, compilation aborted!
$ /builddirs/llvm-project/build-Clang8-unknown/bin/opt -instcombine zz.ll -o - -S
; ModuleID = 'zz.ll'
source_filename = "zz.ll"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @d(i32 %X, i32 %Y, i32 %Z) {
bb:
%t0 = mul nsw i32 %Z, %Y
%0 = srem i32 %X, %t0
%1 = srem i32 %0, %Y
ret i32 %1
}
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65298/new/
https://reviews.llvm.org/D65298
More information about the llvm-commits
mailing list