This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SimplifyCFG] Hoisting invalidates metadata
We forgot to remove optimization metadata when performing hosting during FoldTwoEntryPHINode. This fixes PR29163. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279980 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
; RUN: opt -S -simplifycfg < %s | FileCheck %s | ||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
@GV = external constant i64* | ||
|
||
define i64* @test1(i1 %cond, i8* %P) { | ||
entry: | ||
br i1 %cond, label %if, label %then | ||
|
||
then: | ||
%bc = bitcast i8* %P to i64* | ||
br label %join | ||
|
||
if: | ||
%load = load i64*, i64** @GV, align 8, !dereferenceable !0 | ||
br label %join | ||
|
||
join: | ||
%phi = phi i64* [ %bc, %then ], [ %load, %if ] | ||
ret i64* %phi | ||
} | ||
|
||
; CHECK-LABEL: define i64* @test1( | ||
; CHECK: %[[bc:.*]] = bitcast i8* %P to i64* | ||
; CHECK: %[[load:.*]] = load i64*, i64** @GV, align 8{{$}} | ||
; CHECK: %[[phi:.*]] = select i1 %cond, i64* %[[load]], i64* %[[bc]] | ||
; CHECK: ret i64* %[[phi]] | ||
|
||
|
||
!0 = !{i64 8} |