Open orbiri opened 4 days ago
This might be related to #480?
found the root cause in CIRGenScalarExpr, will publish a fix over the coming week that simplifies the generated code for most cases.
Nice!
tests of lowering of complicated scopes and control flow should not check for the way that conditions are evaluated
+1
This might be related to https://github.com/llvm/clangir/issues/480?
Are there cases related with i8-i1 as well?
Uploaded fix + WIP tests in #1110
Still need to add some nice documentation, real commitdesc etc, and make all tests pass :)
Unfortunately since #480 is in C++ this issue is unrelated.
When looking at some C generated code I noticed that most
cir.cmp
operations that were generated were of types32i
, and then immediately converted to bool before used in if statements etc.I found the root cause in CIRGenScalarExpr, will publish a fix over the coming week that simplifies the generated code for most cases.
———
I will note that a lot of tests rely on 1:1 generated CIR/LLVMIR, even without using file check variables, which makes such changes a lot harder than they could have been! For example, tests of lowering of complicated scopes and control flow should not check for the way that conditions are evaluated.