-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete the incorrect assert that assumes size of APFloat
is the same as IEEEFloat
.
#111780
Conversation
@llvm/pr-subscribers-llvm-adt Author: Daniel Chen (DanielCChen) ChangesThis addition of the the following code in commit 6004f55#diff-3ec11da67f69353fd755e59cc71f551b5e93773fd4e6f6327c7f1c7074a82709R1474
broke our downstream code as not all the members of This PR is to delete the assertion. @Ariel-Burton Full diff: https://github.com/llvm/llvm-project/pull/111780.diff 1 Files Affected:
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 6f1e24e5da33a9..de11cd93b48478 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -1473,9 +1473,6 @@ class APFloat : public APFloatBase {
friend DoubleAPFloat;
};
-static_assert(sizeof(APFloat) == sizeof(detail::IEEEFloat),
- "Empty base class optimization is not performed.");
-
/// See friend declarations above.
///
/// These additional declarations are required in order to compile LLVM with IBM
|
This assertion is to make sure that EBO is performed on APFloat. What is the compiler you use to build llvm? |
We are building it on Linux on Power and AIX. This code broke our downstream code we have inside of APFloat that are not IEEE. |
Can you please try to compile the following code with your compiler? https://godbolt.org/z/4jqhnjG3E
|
Oh I see. Do you add a new impl whose size is larger than |
If so, at least we can assert |
The issue is that APFloat has a union ( It's not a matter of the compiler used to build, but the assumption that no member of the |
Oh, that might work. |
That's an interesting idea, but needs care to get it to work because if the assert is APFloat it won't compile because APFloat isn't complete until after the closing brace. It can't go outside We could add a new
|
Make sense to me. |
So the assert isn't wrong if you're actually changing the type downstream. If you're changing the type downstream you have to also change the assert downstream |
Yeah, I don't think we should change the assert upstream. When you add support for your new floating point type upstream, we can decide whether we're willing to increase the APFloat size for it, or you need to reduce the size of your representation (e.g. by indirecting via an allocation, just like DoubleAPFloat does). |
Thanks for all the comments. We are currently looking into the issue. |
…m#98308) ARM uses complex encoding of immediate values using small number of bits. As a result, some values cannot be represented as immediate operands, they need to be synthesized in a register. This change implements legalization of such constants with loading values from constant pool. --------- Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
Factor out and unify common code from InstSimplify and InstCombine that partially guard against cross-lane vector operations into llvm::isNotCrossLaneOperation in ValueTracking. Alive2 proofs for changed tests: https://alive2.llvm.org/ce/z/68H4ka
…)" This reverts commit d6827f6 due to the following CMake configure failure being observed by some: add_custom_target called with invalid target name
…111798) avr-gcc also rejects since these devices has no SRAM. Fixes llvm#96881
…UFB (llvm#112175) If each 128-bit vXi8 lane is shifting the same constant value, we can pre-compute the 8 valid shift results and use PSHUFB to act as a LUT with the shift amount. Fixes llvm#110317
…llvm#111302) Gentoo is planning to introduce a `*t64` suffix for triples that will be used by 32-bit platforms that use 64-bit `time_t`. Add support for parsing and accepting these triples, and while at it make clang automatically enable the necessary glibc feature macros when this suffix is used. An open question is whether we can backport this to LLVM 19.x. After all, adding new triplets to Triple sounds like an ABI change — though I suppose we can minimize the risk of breaking something if we move new enum values to the very end.
llvm#112184) … (llvm#111970)" I was made aware of breakages in Windows/ARM, so reverting while I investigate. This reverts commit f3aebe6.
…ted expressions (llvm#111701) Done by calling clang::runWithSufficientStackSpace(). Added CodeGenModule::runWithSufficientStackSpace() method similar to the one in Sema to provide a single warning when this triggers Fixes: llvm#111699
The profiling code requires GNU extensions as it uses functions such as getpagesize(), fdopen(), etc. The problem manifests when the compiler is built to not default to the extensions mode, e.g. custom config with -std=c2x. CMake didn't support this scenario very well, but it's been fixed by CMP0128. Set the policy to NEW as we now conform to it.
…lvm#110824) Retain SCEVSequentialMinMaxExpr if an operand may trigger UB, e.g. if there is an UDiv operand that may divide by 0 or poison PR: llvm#110824
Sorry that I messed up my local branch. I will close this PR and re-post another one shortly. |
This addition of the the following code in commit 6004f55#diff-3ec11da67f69353fd755e59cc71f551b5e93773fd4e6f6327c7f1c7074a82709R1474
broke our downstream code as not all the members of
APFloat
is IEEE.This PR is to delete the assertion.
@Ariel-Burton