[PATCH] D62266: [DAGCombine][X86][AArch64][ARM] (C - x) + y -> (y - x) + C fold
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 29 13:43:13 PDT 2019
dmgreen added a comment.
Hello. I found this code that seems to loop forever:
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv6m-arm-none-eabi"
@a = dso_local local_unnamed_addr global i32 0, align 4
@b = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: minsize nounwind optsize
define dso_local i32 @c() local_unnamed_addr #0 {
entry:
%0 = load i32, i32* @a, align 4
%sub = sub nsw i32 2000, %0
%call = tail call i32 bitcast (i32 (...)* @d to i32 (i32)*)(i32 %sub) #2
%1 = load i32, i32* @b, align 4
%cmp = icmp sgt i32 %1, 1999
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%call1 = tail call i32 bitcast (i32 (...)* @e to i32 ()*)() #2
br label %if.end
if.end: ; preds = %if.then, %entry
ret i32 undef
}
declare dso_local i32 @d(...) local_unnamed_addr #1
declare dso_local i32 @e(...) local_unnamed_addr #1
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62266/new/
https://reviews.llvm.org/D62266
More information about the llvm-commits
mailing list