Files
llvm/polly/test/ScopInfo/variant_base_pointer.ll
Michael Kruse 5a4ec5c42b [ScopDetection] Require LoadInst base pointers to be hoisted.
Only when load-hoisted we can be sure the base pointer is invariant
during the SCoP's execution. Most of the time it would be added to
the required hoists for the alias checks anyway, except with
-polly-ignore-aliasing, -polly-use-runtime-alias-checks=0 or if
AliasAnalysis is already sure it doesn't alias with anything
(for instance if there is no other pointer to alias with).

Two more parts in Polly assume that this load-hoisting took place:
- setNewAccessRelation() which contains an assert which tests this.
- BlockGenerator which would use to the base ptr from the original
  code if not load-hoisted (if the access expression is regenerated)

Differential Revision: https://reviews.llvm.org/D30694

llvm-svn: 297195
2017-03-07 20:28:43 +00:00

39 lines
1.3 KiB
LLVM

; RUN: opt %loadPolly -polly-ignore-aliasing -polly-invariant-load-hoisting=true -polly-scops -analyze < %s | FileCheck %s
; RUN: opt %loadPolly -polly-ignore-aliasing -polly-invariant-load-hoisting=true -polly-codegen -analyze < %s
;
; %tmp is added to the list of required hoists by -polly-scops and just
; assumed to be hoisted. Only -polly-scops recognizes it to be unhoistable
; because ir depends on %call which cannot be executed speculatively.
;
; CHECK-NOT: Invariant Accesses:
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; Function Attrs: nounwind uwtable
define void @cli_hex2int() {
entry:
br label %if.end
if.end: ; preds = %entry
%call = call i16** @__ctype_b_loc() #0
%tmp = load i16*, i16** %call, align 8
%arrayidx = getelementptr inbounds i16, i16* %tmp, i64 0
%tmp1 = load i16, i16* %arrayidx, align 2
store i16 3, i16 *%arrayidx, align 2
br i1 false, label %if.then.2, label %if.end.3
if.then.2: ; preds = %if.end
br label %cleanup
if.end.3: ; preds = %if.end
br label %cleanup
cleanup: ; preds = %if.end.3, %if.then.2
ret void
}
; Function Attrs: nounwind readnone
declare i16** @__ctype_b_loc() #0
attributes #0 = { nounwind readnone }