This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Do not introduce address space cast
ClosedPublic

Authored by etherzhhb on Apr 26 2017, 11:10 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

etherzhhb created this revision.Apr 26 2017, 11:10 PM

I want to also include a test case, if you can point me to the test case related to IslNodeBuilder::preloadUnconditionally, I can add one.
Let me search polly test dir at the same time

grosser edited edge metadata.Apr 26 2017, 11:33 PM

Hi ether,

thank you for the patch. Related test cases are:

Polly :: Isl/CodeGen/inv-load-lnt-crash-wrong-order-3.ll
Polly :: Isl/CodeGen/inv-load-lnt-crash-wrong-order.ll
Polly :: Isl/CodeGen/invariant_cannot_handle_void.ll
Polly :: Isl/CodeGen/invariant_load_complex_condition.ll
Polly :: Isl/CodeGen/invariant_load_different_sized_types.ll
Polly :: Isl/CodeGen/invariant_loads_from_struct_with_different_types_1.ll
Polly :: Isl/CodeGen/invariant_loads_from_struct_with_different_types_2.ll
Polly :: Isl/CodeGen/multiple-types-invariant-load.ll
Polly :: ScopInfo/invariant-loads-leave-read-only-statements.ll
Polly :: ScopInfo/invariant_load_access_classes_different_base_type.ll
Polly :: ScopInfo/invariant_load_access_classes_different_base_type_escaping.ll
Polly :: ScopInfo/invariant_load_access_classes_different_base_type_same_pointer.ll
Polly :: ScopInfo/invariant_load_access_classes_different_base_type_same_pointer_escaping.ll
etherzhhb updated this revision to Diff 96874.Apr 26 2017, 11:34 PM

Add testcase

Also, please add llvm-commits and pollydev in CC (see other polly reviews) and also mark this as #Polly project.

etherzhhb added a project: Restricted Project.
etherzhhb added subscribers: pollydev, llvm-commits.
grosser added a comment.EditedApr 26 2017, 11:37 PM

Hi ether,

I just run your patch, but the test case you added breaks:

opt  -polly-process-unprofitable  -polly-remarks-minimal  -polly-codegen -polly-invariant-load-hoisting=true -S < /home/grosser/Projects/polly/git/tools/polly/test/Isl/CodeGen/invariant_load_address_space.ll | FileCheck /home/grosser/Projects/polly/git/tools/polly/test/Isl/CodeGen/invariant_load_address_space.ll
--
Exit Code: 1

Command Output (stderr):
--
/home/grosser/Projects/polly/git/tools/polly/test/Isl/CodeGen/invariant_load_address_space.ll:4:15: error: expected string not found in input
; CHECK-NEXT: %polly.access.B = getelementptr i32, i32 addrspace(5)* %B, i64 0
              ^
<stdin>:13:22: note: scanning from here
polly.preload.begin: ; preds = %polly.split_new_and_old
                     ^
<stdin>:14:2: note: possible intended match here
 %polly.access.B = getelementptr i32, i32 addrspace(1)* %B, i64 0

The input code does not contain any element from address space 5? Is this intended?

etherzhhb updated this revision to Diff 96875.Apr 26 2017, 11:39 PM

Fix the test case.

grosser accepted this revision.Apr 26 2017, 11:51 PM

LGTM. Thank you!

This revision is now accepted and ready to land.Apr 26 2017, 11:51 PM
This revision was automatically updated to reflect the committed changes.