[PATCH] D111023: [ConstantFold] Refactor load folding
Yevgeny Rouban via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 7 03:15:31 PDT 2021
yrouban added inline comments.
================
Comment at: llvm/test/Transforms/InstSimplify/ConstProp/loads.ll:34-38
+; LE-LABEL: @test2_addrspacecast(
+; LE-NEXT: ret i16 -16657
+;
+; BE-LABEL: @test2_addrspacecast(
+; BE-NEXT: ret i16 -8531
----------------
Nikita, Artur, Philip,
I think this this test is not correct.
As I found in our internal sources the method //stripPointerCastsAndOffsets()// does not allow to collect offsets through addrspacecasts. Here is the exact wording by Philip Reames:
// NOTE: Looking through a addrspacecast is not legal here since it would
// change address spaces (and thus possibly pointer sizes)
I found that the LangRef specifies that the memory location is preserved through addrspacecasts. But nothing is said about sizes. What if we have big-endian in addrspace(0) and little-endian in addrspace(1)?
If you agree, I can upstream the one line change in Value.cpp that stops offset calculation at addrspacecasts.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111023/new/
https://reviews.llvm.org/D111023
More information about the llvm-commits
mailing list